%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/unittest/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/unittest/__pycache__/main.cpython-312.pyc

�

���f�.���dZddlZddlZddlZddlZddlmZmZddlm	Z	dZ
dZdZd	Z
d
�Zd�Zd�ZGd
�de�ZeZy)zUnittest main program�N�)�loader�runner)�installHandlerT�aExamples:
  %(prog)s test_module               - run tests from test_module
  %(prog)s module.TestClass          - run tests from module.TestClass
  %(prog)s module.Class.test_method  - run specified test method
  %(prog)s path/to/test_file.py      - run tests from test_file.py
aFExamples:
  %(prog)s                           - run default set of tests
  %(prog)s MyTestSuite               - run suite 'MyTestSuite'
  %(prog)s MyTestCase.testSomething  - run MyTestCase.testSomething
  %(prog)s MyTestCase                - run all 'test*' test methods
                                       in MyTestCase
c�,�tjj|�r�|j�j	d�r�tjj|�rttjj
|tj��}tjj|�s|jtj�r|S|}tjj|�ddjdd�jdd�S|S)Nz.py����\�.�/)�os�path�isfile�lower�endswith�isabs�relpath�getcwd�
startswith�pardir�normpath�replace)�name�rel_paths  �$/usr/lib/python3.12/unittest/main.py�
_convert_namers���

�w�w�~�~�d���
�
�� 5� 5�e� <�
�7�7�=�=����w�w���t�R�Y�Y�[�9�H��w�w�}�}�X�&�(�*=�*=�b�i�i�*H����D��w�w����%�c�r�*�2�2�4��=�E�E�c�3�O�O��K�c�>�|D�cgc]
}t|���c}Scc}w�N)r)�namesrs  r�_convert_namesr!/s��,1�2�D�M�$��2�2��2s�c��d|vrd|z}|S)N�*z*%s*�)�patterns r�_convert_select_patternr&3s���'�>��7�"���Nrc��eZdZdZdZdZdxZxZxZxZ	xZ
ZdZdddde
jddddddfddd�d�Zdd	�Zd
�Zd�Zdd�Zd
�Zd�Zd�Zd�Zdd�Zd�Zy)�TestProgramzA command-line program that runs a set of tests; this is primarily
       for making test modules conveniently executable.
    Nr�__main__TF)�	tb_locals�	durationsc�>�t|t�rEt|�|_|j	d�ddD]}t|j|�|_�n||_|�tj}||_||_	|	|_
||_|
|_||_
|
|_|�tjsd|_n||_||_||_||_t(j*j-|d�|_|j1|�|j3�y)Nrr�defaultr)�
isinstance�str�
__import__�module�split�getattr�sys�argv�exit�failfast�
catchbreak�	verbosity�bufferr*r+�warnoptions�warnings�defaultTest�
testRunner�
testLoaderr
r�basename�progName�	parseArgs�runTests)�selfr1r=r5r>r?r6r9r7r8r:r<r*r+�parts               r�__init__zTestProgram.__init__Cs���
�f�c�"�$�V�,�D�K����S�)�!�"�-�
9��%�d�k�k�4�8���
9�!�D�K��<��8�8�D���	� ��
�$���"������"���"�����C�O�O�&�D�M�%�D�M�&���$���$������(�(��a��1��
����t���
�
�rc���tjdt�|rt|�|j�|j�|j
�tjd�y)NzHTestProgram.usageExit() is deprecated and will be removed in Python 3.13�)	r<�warn�DeprecationWarning�print�_discovery_parser�_initArgParsers�_print_helpr4r6)rD�msgs  r�	usageExitzTestProgram.usageExitksP���
�
�0�1C�	E���#�J��!�!�)�� � �"���������rc�V�|j�\t|jj��ttd|j
iz�|jj�yt|jj��ttd|j
iz�y)N�prog)	r1rK�_main_parser�format_help�
MAIN_EXAMPLESrArL�
print_help�MODULE_EXAMPLES)rD�args�kwargss   rrNzTestProgram._print_helpusx���;�;���$�#�#�/�/�1�2��-�6�4�=�=�"9�9�:��"�"�-�-�/��$�#�#�/�/�1�2��/�V�T�]�]�$;�;�<rc��|j�|j�vt|�dkDr+|dj�dk(r|j	|dd�y|j
j
|dd|�|js1|j	g�y|j
j
|dd|�|jr+t|j�|_	tdk(rcd|_n[|j�d|_	nGt|jt�r|jf|_	nt|j�|_	|j�y)Nr�discoverrHr))rMr1�lenr�
_do_discoveryrS�
parse_args�testsr!�	testNames�__name__r=r.r/�list�createTests)rDr5s  rrBzTestProgram.parseArgs~s�������;�;���4�y�1�}��a�����J�!>��"�"�4���8�,�����(�(��a�b��4�8��:�:��"�"�2�&�����(�(��a�b��4�8��:�:�+�D�J�J�7�D�N��:�%�"���
�
�
�
%�!�D�N�
��(�(�#�
.�"�.�.�0�D�N�!�$�"2�"2�3�D�N����rc���|jr|j|j_|rM|�|jn|�}|j|j|j|j
�|_y|j�+|jj|j�|_y|jj|j|j�|_yr)�testNamePatternsr?r[�startr%�top�testr`�loadTestsFromModuler1�loadTestsFromNames)rD�from_discovery�Loaderrs    rrczTestProgram.createTests�s���� � �/3�/D�/D�D�O�O�,��(.��T�_�_�F�H�F�'�����
�
�D�L�L�$�(�(�K�D�I�
�^�^�
#����;�;�D�K�K�H�D�I����:�:�4�>�>�;?�;�;�H�D�Irc�|�|j�}|j|�|_|j|�|_yr)�_getParentArgParser�_getMainArgParserrS�_getDiscoveryArgParserrL)rD�
parent_parsers  rrMzTestProgram._initArgParsers�s6���0�0�2�
� �2�2�=�A���!%�!<�!<�]�!K��rc�>�tjd��}|jdddddd�	�|jd
ddddd
�	�|jdddd��|jddtddd��|j�|jddddd��d|_|j
�|jddddd��d|_|j�|jd d!d"dd#��d|_|j�!|jd$d%d&td'�(�g|_|S))NF)�add_helpz-vz	--verboser9�store_constrHzVerbose output)�dest�action�const�helpz-qz--quietrzQuiet outputz--localsr*�
store_truez"Show local variables in tracebacks)rurvrxz--durationsr+�Nz+Show the N slowest test cases (N=0 for all))ru�typer-�metavarrxz-fz
--failfastr7zStop on first fail or errorz-cz--catchr8z'Catch Ctrl-C and display results so farz-bz--bufferr:z%Buffer stdout and stderr during testsz-kre�appendz.Only run tests which match the given substring)rurvr{rx)	�argparse�ArgumentParser�add_argument�intr7r8r:rer&)rD�parsers  rrnzTestProgram._getParentArgParser�sr���(�(�%�8�����D�+�K�#0��!1�	�	3�	���D�)�+�#0��!/�	�	1�	���J�[�#/�!E�	�	G�	���M��#�$(�#�!N�	�	P��=�=� �����l��'3�%B�
 �
D�"�D�M��?�?�"�����i�l�'3�%N�
 �
P�$�D�O��;�;������j�x�'3�%L�
 �
N� �D�K�� � �(�����+=�'/�6M�%U�
 �
W�%'�D�!��
rc��tj|g��}|j|_|j|_|j
ddd��|S)N��parentsr_r#z?a list of any number of test modules, classes and test methods.)�nargsrx)r~rrArRrNrVr�)rD�parentr�s   rrozTestProgram._getMainArgParser�sP���(�(�&��:���m�m��� �,�,������G�3�"8�	�	9��
rc�X�tj|g��}d|jz|_d|_|jdddd��|jd	d
dd��|jd
ddd��dD]3}|j|dtjtj���5|S)Nr�z%s discoverzcFor test discovery all test modules must be importable from the top level directory of the project.z-sz--start-directoryrfz*Directory to start discovery ('.' default))rurxz-pz	--patternr%z+Pattern to match tests ('test*.py' default)z-tz--top-level-directoryrgz<Top level directory of project (defaults to start directory))rfr%rg�?)r�r-rx)r~rrArR�epilogr��SUPPRESS)rDr�r��args    rrpz"TestProgram._getDiscoveryArgParser�s����(�(�&��:��#�d�m�m�3���$��
�	���D�"5�G�!M�	�	O����D�+�I�!N�	�	P����D�"9��"4�	�	5�/�	8�C�����3�(0�(9�(9�%-�%6�%6�
 �
8�	8�
�
rc���d|_d|_d|_|�8|j�|j	�|jj||�|j
d|��y)Nrztest*.pyT)rkrl)rfr%rgrLrMr^rc)rDr5rls   rr]zTestProgram._do_discovery�s^����
�!���������%�%�-��$�$�&��"�"�-�-�d�D�9�����V��<rc���|jr
t�|j�tj|_t|jt�rV		|j|j|j|j|j|j|j��}n|j}|j|j�|_|j"r�|j j$dk(r<t'|j j(�dk(rt+j"t,�y|j j/�rt+j"d�yt+j"d�yy#t$rA|j|j|j|j|j��}Y��wxYw#t$r|j�}Y��1wxYw)N)r9r7r:r<r*r+)r9r7r:r<rr)r8rr>r�TextTestRunnerr.r{r9r7r:r<r*r+�	TypeError�runrh�resultr6�testsRunr\�skippedr4�_NO_TESTS_EXITCODE�
wasSuccessful)rDr>s  rrCzTestProgram.runTests�sa���?�?����?�?�"�$�3�3�D�O��d�o�o�t�,�
/�I�!%���4�>�>�:>�-�-�8<���:>�-�-�;?�>�>�;?�>�>�"1�"K�J��"���J� �n�n�T�Y�Y�/����9�9��{�{�#�#�q�(�S����1D�1D�-E��-J����+�,����*�*�,�����������
��!�I�!%���4�>�>�:>�-�-�8<���:>�-�-�"1�"I�J�I���
/�!�_�_�.�
�
/�s,�AE<�<AG�G	�G�G	�	G&�%G&r)FN)ra�
__module__�__qualname__�__doc__r1r9r7r8r:rAr<rerLr�defaultTestLoaderrFrPrNrBrcrMrnrorpr]rCr$rrr(r(9s�����F��I�NR�R�H�R�z�R�F�R�X�R��;K���(�d��#��0H�0H���T�d��$�&�>C�"�	&�P�=��:
H�L�
$�L	��*=�!rr()r�r4r~r
r<�rr�signalsr�
__unittestr�rUrWrr!r&�objectr(�mainr$rr�<module>r�sX���
��	���#�
�
����
���� 3��g�&�g�T�r

Zerion Mini Shell 1.0