opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
nose
/
tools
/
__pycache__
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
__init__.cpython-312.pyc
562 bytes
Rename
Delete
nontrivial.cpython-312.pyc
5.87 KB
Rename
Delete
trivial.cpython-312.pyc
2.16 KB
Rename
Delete
� ��gJ � �Z � d Z ddlZg d�Z G d� de� Zd� Zd� Zd� Zd � Zd d �Z d� Z d� Zy)z8Tools not exempt from being descended into in tracebacks� N)�make_decorator�raises� set_trace�timed� with_setup�TimeExpired�istest�nottestc � � e Zd Zy)r N)�__name__� __module__�__qualname__� � �D/opt/hc_python/lib/python3.12/site-packages/nose/tools/nontrivial.pyr r s � �r r c � � � � fd�}|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). c �D �� t �d� r �j }n�j }�j | _ �j | _ �j | _ t | d� s�j j | _ || _ | S # t $ r || _ Y | S w xY w)N�compat_func_name�compat_co_firstlineno) �hasattrr r �__dict__�__doc__r �__code__�co_firstlinenor � TypeError)�newfunc�name�funcs �r �decoratez make_decorator.<locals>.decorate s� �� ��4�+�,��(�(�D��=�=�D��=�=����,�,���!�_�_����w� 7�8�,0�M�M�,H�,H�G�)� ,�#�G�� ��� � ,�'+�G�$��� ,�s �B �B�Br )r r s ` r r r s �� �� �Or c �r � �� dj � D �cg c] }|j �� c}� �� �fd�}|S c c}w )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 c �V �� �� � j ��� ��fd�} t � � |� }|S )Nc �R �� �| i |�� ��d���}t |� �# �$ r Y y � xY w)Nz() did not raise )�AssertionError)�arg�kw�message� exceptionsr r �valids ����r r z)raises.<locals>.decorate.<locals>.newfunc: sC �� � .��c� �R� � 6:�5�A��$�W�-�-�� � �� ��s � �&�&)r r )r r r r'