File: //usr/lib/python2.7/site-packages/_pytest/recwarn.pyo
�
��abc @` s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l
Z
d d l Z d d l m
Z
d d l m Z e
d � � Z d d � Z d e f d � � YZ d
� Z d e
j f d � � YZ d
e f d � � YZ d S( s4 recording warnings during test function execution. i ( t absolute_importt divisiont print_functionN( t
yield_fixture( t failc c` s, t � } | � t j d � | VWd QXd S( s Return a WarningsRecorder instance that provides these methods:
* ``pop(category=None)``: return last warning matching the category.
* ``clear()``: clear list of warnings
See http://docs.python.org/library/warnings.html for information
on warning categories.
t defaultN( t WarningsRecordert warningst simplefilter( t wrec( ( s3 /usr/lib/python2.7/site-packages/_pytest/recwarn.pyt recwarn s
c O` s4 | s
t � St } t � � | | | � SWd QXd S( sG context manager that can be used to ensure a block of code triggers a
``DeprecationWarning`` or ``PendingDeprecationWarning``::
>>> import warnings
>>> def api_call_v2():
... warnings.warn('use v3 of this api', DeprecationWarning)
... return 200
>>> with deprecated_call():
... assert api_call_v2() == 200
``deprecated_call`` can also be used by passing a function and ``*args`` and ``*kwargs``,
in which case it will ensure calling ``func(*args, **kwargs)`` produces one of the warnings
types above.
N( t _DeprecatedCallContextt True( t funct argst kwargst __tracebackhide__( ( s3 /usr/lib/python2.7/site-packages/_pytest/recwarn.pyt deprecated_call! s
R c B` s5 e Z d Z d � Z d � Z d d � Z d � Z RS( sJ Implements the logic to capture deprecation warnings as a context manager.c C` s= g | _ t j | _ t j | _ | j t _ | j t _ d S( N( t _captured_categoriesR t warnt _old_warnt
warn_explicitt _old_warn_explicitt _warn_explicitt _warn( t self( ( s3 /usr/lib/python2.7/site-packages/_pytest/recwarn.pyt __enter__<