%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/nose/tools/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/nose/tools/__pycache__/nontrivial.cpython-37.pyc

B

9�`J�@sndZddlZddddddd	d
gZGdd�de�Zdd�Zd
d�Zdd�Zdd�Zddd�Z	dd	�Z
dd
�ZdS)z8Tools not exempt from being descended into in tracebacks�N�make_decorator�raises�	set_trace�timed�
with_setup�TimeExpired�istest�nottestc@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�F/opt/alt/python37/lib/python3.7/site-packages/nose/tools/nontrivial.pyr
scs�fdd�}|S)z�
    Wraps a test decorator so as to properly replicate metadata
    of the decorated function, including nose's additional stuff
    (namely, setup and teardown).
    csnt�d�r�j}n�j}�j|_�j|_�j|_t|d�sD�jj|_y
||_Wnt	k
rh||_YnX|S)N�compat_func_name�compat_co_firstlineno)
�hasattrrr
�__dict__�__doc__r�__code__�co_firstlinenor�	TypeError)�newfunc�name)�funcr
r�decorates



z make_decorator.<locals>.decorater
)rrr
)rrrscs&d�dd��D�����fdd�}|S)a�Test must raise one of expected exceptions to pass.

    Example use::

      @raises(TypeError, ValueError)
      def test_raises_type_error():
          raise TypeError("This test passes")

      @raises(Exception)
      def test_that_fails_by_passing():
          pass

    If you want to test many assertions about exceptions in a single test,
    you may want to use `assert_raises` instead.
    z or cSsg|]
}|j�qSr
)r
)�.0�er
r
r�
<listcomp>7szraises.<locals>.<listcomp>cs(�j�����fdd�}t��|�}|S)NcsHy�||�Wn �k
r"Yn"�YnXd��f}t|��dS)Nz%s() did not raise %s)�AssertionError)�arg�kw�message)�
exceptionsrr�validr
rr:sz)raises.<locals>.decorate.<locals>.newfunc)r
r)rr)r"r#)rrrr8s
zraises.<locals>.decorate)�join)r"rr
)r"r#rr'scCs6ddl}ddl}|j}|j|_|���|��j�dS)z�Call pdb.set_trace in the calling frame, first restoring
    sys.stdout to the real output stream. Note that sys.stdout is NOT
    reset to whatever it was before the call once pdb is done!
    rN)�pdb�sys�stdout�
__stdout__ZPdbr�	_getframe�f_back)r%r&r'r
r
rrIs
cs�fdd�}|S)z�Test must finish within specified time limit to pass.

    Example use::

      @timed(.1)
      def test_that_fails():
          time.sleep(.2)
    cs��fdd�}t��|�}|S)Ncs6t��}�||�}t��}||�kr2td���|S)NzTime limit (%s) exceeded)�timer)rr �start�result�end)r�limitr
rr_s
z(timed.<locals>.decorate.<locals>.newfunc)r)rr)r/)rrr^sztimed.<locals>.decorater
)r/rr
)r/rrUs	
cCs||fdd�}|S)aDecorator to add setup and/or teardown methods to a test function::

      @with_setup(setup, teardown)
      def test_something():
          " ... "

    Note that `with_setup` is useful *only* for test functions, not for test
    methods or inside of TestCase subclasses.
    csd�r0t|d�r*|j���fdd�}||_n�|_�r`t|d�rZ|j���fdd�}||_n�|_|S)N�setupcs����dS)Nr
r
)�_old_sr0r
r�_sysz(with_setup.<locals>.decorate.<locals>._s�teardowncs����dS)Nr
r
)�_old_tr3r
r�_t�sz(with_setup.<locals>.decorate.<locals>._t)rr0r3)rr0r3r2r5r
)r1r4r0r3rrus

zwith_setup.<locals>.decorater
)r0r3rr
r
rrks
cCs
d|_|S)z5Decorator to mark a function or method as a test
    T)�__test__)rr
r
rr�scCs
d|_|S)z;Decorator to mark a function or method as *not* a test
    F)r6)rr
r
rr	�s)NN)rr+�__all__rrrrrrrrr	r
r
r
r�<module>s

"
!

Zerion Mini Shell 1.0