File: //opt/alt/python27/lib/python2.7/site-packages/nose/plugins/capture.pyo
�
k�6Sc           @   s�   d  Z  d d l Z d d l Z d d l Z d d l m Z d d l m Z m Z d d l	 m
 Z
 d d l m Z e j e
 � Z d e f d �  �  YZ d S(	   s_  
This plugin captures stdout during test execution. If the test fails
or raises an error, the captured output will be appended to the error
or failure output. It is enabled by default but can be disabled with
the options ``-s`` or ``--nocapture``.
:Options:
  ``--nocapture``
    Don't capture stdout (any stdout output will be printed immediately)
i����N(   t   Plugin(   t   exc_to_unicodet
   force_unicode(   t   ln(   t   StringIOt   Capturec           B   s�   e  Z d  Z e Z d Z d Z d Z d �  Z d �  Z	 d �  Z
 d �  Z d �  Z d	 �  Z
 d
 �  Z d �  Z d �  Z d
 �  Z d �  Z d �  Z d �  Z e e d d d � Z RS(   s  
    Output capture plugin. Enabled by default. Disable with ``-s`` or
    ``--nocapture``. This plugin captures stdout during test execution,
    appending any output captured to the error or failure output,
    should the test fail or raise an error.
    t   NOSE_NOCAPTUREt   capturei@  c         C   s   g  |  _  d  |  _ d  S(   N(   t   stdoutt   Nonet   _buf(   t   self(    (    sE   /opt/alt/python27/lib/python2.7/site-packages/nose/plugins/capture.pyt   __init__#   s    	c         C   s9   | j  d d d d d | j |  j � d d d d	 �d
 S(   s%   Register commandline options
        s   -ss   --nocapturet   actiont   store_falset   defaultt   destR   t   helpsU   Don't capture stdout (any stdout output will be printed immediately) [NOSE_NOCAPTURE]N(   t
   add_optiont   gett   env_opt(   R   t   parsert   env(    (    sE   /opt/alt/python27/lib/python2.7/site-packages/nose/plugins/capture.pyt   options'