File: //usr/lib/python2.7/site-packages/_pytest/warnings.pyc
�
��abc @` s� d d l m Z m Z m Z d d l Z d d l m Z d d l Z d d l m Z d � Z
d � Z e d � � Z e j
d e � d � � Z d S(
i ( t absolute_importt divisiont print_functionN( t contextmanager( t compatc C` s- | j d � } t | � d k r: | j d | f � � n x# t | � d k r_ | j d � q= Wg | D] } | j � ^ qg \ } } } } } | j | � } | j | � } | r
y% t | � } | d k r� t � n Wqt t f k
r| j d | f � � qXn d } | j
| | | | | � d S( sP
Copy of the warning._setoption function but does not escape arguments.
t :i s too many fields (max 5): %rt i s invalid lineno %rN( t splitt lent _OptionErrort appendt stript
_getactiont _getcategoryt intt
ValueErrort
OverflowErrort filterwarnings( t wmodt argt partst st actiont messaget categoryt modulet lineno( ( s4 /usr/lib/python2.7/site-packages/_pytest/warnings.pyt
_setoption s$ +
c C` sH | j d � } | j d d d d d d �| j d d d
d d �d S( Ns pytest-warningss -Ws --pythonwarningsR R
t helps= set which warnings to report, see -W option of python itself.R t typet linelistsc Each line specifies a pattern for warnings.filterwarnings. Processed after -W and --pythonwarnings.( t getgroupt addoptiont addini( t parsert group( ( s4 /usr/lib/python2.7/site-packages/_pytest/warnings.pyt pytest_addoption$ s c c` s� | j j d � p g } | j j d � } t j d t � ��} x | D] } t j | � qF Wx | D] } t t | � qd W| j d � } | r� x! | j D] } t j | � q� Wn d Vx� | D]� } | j } t
} t j r`t
d � | j D� � r`g } x? | j D]4 }
| j t |
t j � r4t j |
� n |
� qWt | j � | k } | | _ n t j | | j | j | j | j � } | j d | � | r� t j d | t � q� q� WWd QXd S( s�
catches the warnings generated during setup/call/teardown execution
of the given item and after it is done posts them as warnings to this
item.
t pythonwarningsR t recordNc s` s! | ] } t | t j � Vq d S( N( t
isinstanceR t
UNICODE_TYPES( t .0t m( ( s4 /usr/lib/python2.7/site-packages/_pytest/warnings.pys <genexpr>J s t unuseds\ Warning is using unicode non convertible to ascii, converting to a safe representation:
%s( t configt getoptiont getinit warningst catch_warningst TrueR t
get_markert argsR t FalseR t _PY2t anyR
R'