%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/unittest/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python311/lib64/python3.11/unittest/__pycache__/loader.cpython-311.pyc

�

c��fX��l�dZddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZmZm
Z
dZejdej��ZGd�d	ej��Zd
�Zd�Zd�Zd
�Zd�ZGd�de��Ze��Zdd�Ze
jdfd�Zde
jejfd�Z de
jejfd�Z!dS)zLoading unittests.�N)�fnmatch�fnmatchcase�)�case�suite�utilTz[_a-z]\w*\.py$c�,��eZdZdZ�fd�Z�fd�Z�xZS)�_FailedTestNc�f��||_tt|���|��dS�N)�
_exception�superr
�__init__)�self�method_name�	exception�	__class__s   ��6/opt/alt/python311/lib64/python3.11/unittest/loader.pyrz_FailedTest.__init__s.���#���
�k�4� � �)�)�+�6�6�6�6�6�c�z���|�jkr(tt����|��S�fd�}|S)Nc����j�r)r
�rs�r�testFailurez,_FailedTest.__getattr__.<locals>.testFailure!s����/�!r)�_testMethodNamerr
�__getattr__)r�namerrs`  �rrz_FailedTest.__getattr__sO�����4�'�'�'���d�+�+�7�7��=�=�=�	"�	"�	"�	"�	"��r)�__name__�
__module__�__qualname__rrr�
__classcell__�rs@rr
r
sV��������O�7�7�7�7�7���������rr
c�r�d|�dtj����}t|t|��||��S)NzFailed to import test module: �
)�	traceback�
format_exc�_make_failed_test�ImportError)r�
suiteClass�messages   r�_make_failed_import_testr*&s<������i�"�$�$�$�&�G��T�;�w�#7�#7��W�M�M�Mrc�R�dtj����}t||||��S)NzFailed to call load_tests:
)r$r%r&)rrr(r)s    r�_make_failed_load_testsr,+s3���2;�2F�2H�2H�2H�J�G���i��W�.�.�.rc�>�t||��}||f��|fSr)r
)�
methodnamerr(r)�tests     rr&r&0s(���z�9�-�-�D��:�t�g����'�'rc��tjt|����d���}||i}tdtjf|��}|||��f��S)Nc��dSr�rs r�testSkippedz'_make_skipped_test.<locals>.testSkipped5s���r�
ModuleSkipped)r�skip�str�type�TestCase)r.rr(r3�attrs�	TestClasss      r�_make_skipped_testr;4si��	�Y�s�9�~�~���
�
���
�
��%�E��_�t�}�&6��>�>�I��:�y�y��,�,�.�/�/�/rc��|����d��r
|dd�Stj�|��dS)Nz	$py.classi����r)�lower�endswith�os�path�splitext)r@s r�_jython_aware_splitextrB<sI���z�z�|�|���[�)�)���C�R�C�y��
�7���D�!�!�!�$�$rc���eZdZdZdZeej��ZdZ	e
jZdZ
�fd�Zd�Zdd�d�Zdd�Zdd	�Zd
�Zdd�Zd
�Zd�Zd�Zd�Zd�Zd�Z�xZS)�
TestLoaderz�
    This class is responsible for loading tests according to various criteria
    and returning them wrapped in a TestSuite
    r/Nc���tt|�����g|_t	��|_dSr)rrDr�errors�set�_loading_packages)rrs �rrzTestLoader.__init__Ms:���
�j�$���(�(�*�*�*����"%������rc�,�t|tj��rtd���|tjtjfvrg}n*|�|��}|st|d��rdg}|�	t||����}|S)z;Return a suite of all test cases contained in testCaseClasszYTest cases should not be derived from TestSuite. Maybe you meant to derive from TestCase?�runTest)�
issubclassr�	TestSuite�	TypeErrorrr8�FunctionTestCase�getTestCaseNames�hasattrr(�map)r�
testCaseClass�
testCaseNames�loaded_suites    r�loadTestsFromTestCasez TestLoader.loadTestsFromTestCaseTs����m�U�_�5�5�	)��(�)�)�
)��T�]�D�,A�B�B�B��M�M� �1�1�-�@�@�M� �
,�W�]�I�%F�%F�
,�!*��
����s�=�-�'H�'H�I�I���r��patternc���t|��dksd|vr0tjdt��|�dd��t|��dkr4t|��dz}td�|�����t|��dkr7t|��d}td�|�����g}t|��D]�}t||��}t|t��r\t|tj��rB|tjtjfvr(|�|�|������t|dd��}	|�|��}|	�_	|	|||��S#t&$rD}
t)|j|
|j��\}}|j�|��|cYd}
~
Sd}
~
wwxYw|S)	z>Return a suite of all test cases contained in the given moduler�use_load_testsz(use_load_tests is deprecated and ignoredNrzCloadTestsFromModule() takes 1 positional argument but {} were givenz=loadTestsFromModule() got an unexpected keyword argument '{}'�
load_tests)�len�warnings�warn�DeprecationWarning�poprM�format�sorted�dir�getattr�
isinstancer7rKrr8rN�appendrUr(�	Exceptionr,rrF)
r�modulerW�args�kws�	complaint�testsr�objrZ�e�
error_case�
error_messages
             r�loadTestsFromModulezTestLoader.loadTestsFromModulefs���t�9�9�q�=�=�,��3�3��M�D�,�
.�
.�
.��G�G�$�d�+�+�+��t�9�9�q�=�=��D�	�	�A�
�I��a�h�h�ir�s�s�t�t�t��s�8�8�q�=�=�
�s���A��I��[�b�b�cl�m�m�n�n�n�����K�K�	>�	>�D��&�$�'�'�C��3��%�%�
>��s�D�M�2�2�
>���
�t�/D�E�E�E����T�7�7��<�<�=�=�=���V�\�4�8�8�
�����&�&���!�
"�!�z�$��w�7�7�7���
"�
"�
"�,C��O�Q���-9�-9�)�
�M���"�"�=�1�1�1�!�!�!�!�!�!�!�����	
"����
�s�F$�$
G2�.9G-�'G2�-G2c
�v�|�d��}d\}}|��|dd�}|r�	d�|��}t|��}n^#t$rO|���}t||j��\}}|s|j�|��|cYSYnwxYw|��|dd�}|}	|D]�}
	|	t|	|
��}	}�#t$r�}t|	dd���%|�#|j�|��|cYd}~cSt|
||jdtj
������\}}|j�|��|cYd}~cSd}~wwxYwt|	tj��r|�|	��St|	t$��rIt'|	t(j��r/|	t(jt(jfvr|�|	��St|	tj��r�t|t$��rlt'|t(j��rR|d}||��}
tt|
|��tj��s|�|
g��Snt|	t2j��r|	St7|	��rl|	��}t|t2j��r|St|t(j��r|�|g��St9d|	�d	|�d
����t9d|	z���)aSReturn a suite of all test cases given a string specifier.

        The name may resolve either to a module, a test case class, a
        test method within a test case class, or a callable object which
        returns a TestCase or TestSuite instance.

        The method optionally resolves the names relative to a given module.
        �.�NNNr�__path__zFailed to access attribute:
���zcalling z
 returned z, not a testz$don't know how to make test from: %s)�split�join�
__import__r'r_r*r(rFrerc�AttributeErrorr&r$r%rd�types�
ModuleTyperpr7rKrr8rNrU�FunctionTyperrL�callablerM)rrrg�partsrnro�
parts_copy�module_name�next_attributerl�part�parentrm�instr/s               r�loadTestsFromNamezTestLoader.loadTestsFromName�s����
�
�3����$.�!�
�M��>��q�q�q��J��

*�*�"%�(�(�:�"6�"6�K�'��4�4�F���"�*�*�*�%/�^�^�%5�%5�N�0H�&���19�19�-�J�
�%�*���*�*�=�9�9�9�)�)�)�)�*�*�*�����

*��!�"�"�I�E����	&�	&�D�
&�!�7�3��#5�#5�����!�
&�
&�
&��C��T�2�2�>�"�.��K�&�&�}�5�5�5�%�%�%�%�%�%�%�%�%�1B��a����%�0�2�2�2�5�16�16�-�J�
��K�&�&�}�5�5�5�%�%�%�%�%�%�%�%�%�����%
&����(�c�5�+�,�,�	��+�+�C�0�0�0��s�D�!�!�	��3��
�.�.�	��D�M�4�+@�A�A�A��-�-�c�2�2�2���e�0�1�1�		����&�&�		�����/�/�		���9�D��6�$�<�<�D��g�d�D�1�1�5�3E�F�F�
/�����v�.�.�.�
/�
��U�_�
-�
-�	��J��C�=�=�
	J��3�5�5�D��$���0�0�
-����D�$�-�0�0�
-�����v�.�.�.��i�!$���d�d�d�!,�-�-�-��B�S�H�I�I�Is=�$A�AB(�'B(�>C�
E'�.E"�	E'�A	E"�E'�"E'c�N�����fd�|D��}��|��S)z�Return a suite of all test cases found using the given sequence
        of string specifiers. See 'loadTestsFromName()'.
        c�<��g|]}��|�����Sr2)r�)�.0rrgrs  ��r�
<listcomp>z1TestLoader.loadTestsFromNames.<locals>.<listcomp>�s)���I�I�I�4�$�(�(��v�6�6�I�I�Ir)r()r�namesrg�suitess` ` r�loadTestsFromNameszTestLoader.loadTestsFromNames�s5����J�I�I�I�I�5�I�I�I�����v�&�&�&rc�������fd�}tt|t�������}�jr-|�tj�j�����|S)zLReturn a sorted sequence of method names found within testCaseClass
        c����|��j��sdSt�|��}t|��sdSd�j�j|fz��jdupt�fd��jD����S)NFz%s.%s.%sc3�8�K�|]}t�|��V��dSr)r)r�rW�fullNames  �r�	<genexpr>zKTestLoader.getTestCaseNames.<locals>.shouldIncludeMethod.<locals>.<genexpr>�s-�����X�X�w�K��'�2�2�X�X�X�X�X�Xr)�
startswith�testMethodPrefixrcr}rr�testNamePatterns�any)�attrname�testFuncr�rrRs  @��r�shouldIncludeMethodz8TestLoader.getTestCaseNames.<locals>.shouldIncludeMethod�s������&�&�t�'<�=�=�
��u��}�h�7�7�H��H�%�%�
��u�"��(�-�*D�h�&��H��(�D�0�Y��X�X�X�X�$�BW�X�X�X�X�X�
Yr)�key)�list�filterrb�sortTestMethodsUsing�sort�	functools�
cmp_to_key)rrRr��testFnNamess``  rrOzTestLoader.getTestCaseNames�s�����
	Y�
	Y�
	Y�
	Y�
	Y�
	Y��6�"5�s�=�7I�7I�J�J�K�K���$�	R�����!5�d�6O�!P�!P��Q�Q�Q��r�test*.pyc���d}|�|j�|j}n|�d}|}tj�|��}|tjvr tj�d|��||_d}tj�tj�|����retj�|��}||kr>tj�tj�|d����}�n	t|��tj
|}|�d��d}	tj�tj�|j
����}nD#t$r7|jtjvrt#d��d�t#d|����d�wxYw|r9|�|��|_tj�|��n#t($rd}YnwxYw|rt)d	|z���t+|�||����}|�|��S)
a%Find and return all test modules from the specified start
        directory, recursing into subdirectories to find them and return all
        tests found within them. Only test files that match the pattern will
        be loaded. (Using shell style pattern matching.)

        All test modules must be importable from the top level of the project.
        If the start directory is not the top level directory then the top
        level directory must be specified separately.

        If a test package name (directory with '__init__.py') matches the
        pattern then the package will be checked for a 'load_tests' function. If
        this exists then it will be called with (loader, tests, pattern) unless
        the package has already had load_tests called from the same discovery
        invocation, in which case the package module object is not scanned for
        tests - this ensures that when a package uses discover to further
        discover child tests that infinite recursion does not happen.

        If load_tests exists then discovery does *not* recurse into the package,
        load_tests is responsible for loading all tests in the package.

        The pattern is deliberately not stored as a loader attribute so that
        packages can continue discovery themselves. top_level_dir is stored so
        load_tests does not need to pass this argument in to loader.discover().

        Paths are sorted before being imported to ensure reproducible execution
        order even on filesystems with non-alphabetical ordering like ext3/4.
        FNTr�__init__.pyrrz2Can not use builtin modules as dotted module namesz don't know how to discover from z%Start directory is not importable: %r)�_top_level_dirr?r@�abspath�sys�insert�isdir�isfilerwrx�modulesrv�dirname�__file__ryr�builtin_module_namesrM� _get_directory_containing_module�remover'r��_find_testsr()	r�	start_dirrW�
top_level_dir�set_implicit_top�is_not_importable�
the_module�top_partrks	         r�discoverzTestLoader.discover�se��8!��� �T�%8�%D� �/�M�M�
�
"�#��%�M�����
�6�6�
����(�(�

�H�O�O�A�}�-�-�-�+���!��
�7�=�=������3�3�4�4�	3�����	�2�2�I��M�)�)�(*����r�w�|�|�I�}�7]�7]�(^�(^�$^�!��
3��9�%�%�%�!�[��3�
�$�?�?�3�/�/��2��(� "���������)<�>�>�!@�!@�I�I��%�(�(�(�!�*�c�.F�F�F�'�)A�B�B�GK�L�(�M�z�M�M���#'�(�
(����$�3�*.�*O�*O�PX�*Y�*Y�D�'��H�O�O�M�2�2�2���)�
)�
)�
)�$(�!�!�!�
)����,�	S��E�	�Q�R�R�R��T�%�%�i��9�9�:�:�����u�%�%�%s �H�AF�AG�H �H c��tj|}tj�|j��}tj�|������d��r<tj�	tj�	|����Stj�	|��S)Nr�)
r�r�r?r@r�r��basenamer=r�r�)rr�rg�	full_paths    rr�z+TestLoader._get_directory_containing_moduleQs�����[�)���G�O�O�F�O�4�4�	�
�7���I�&�&�,�,�.�.�9�9�-�H�H�	.��7�?�?�2�7�?�?�9�#=�#=�>�>�>�
�7�?�?�9�-�-�-rc��||jkrdSttj�|����}tj�||j��}tj�|��r
Jd���|�d��r
Jd���|�tjj	d��}|S)NrrzPath must be within the projectz..)
r�rBr?r@�normpath�relpath�isabsr��replace�sep)rr@�_relpathrs    r�_get_name_from_pathzTestLoader._get_name_from_path]s����4�&�&�&��3�%�b�g�&6�&6�t�&<�&<�=�=���7�?�?�4��)<�=�=���7�=�=��*�*�M�M�,M�M�M�*��&�&�t�,�,�O�O�.O�O�O�,�������S�1�1���rc�D�t|��tj|Sr)rxr�r�)rrs  r�_get_module_from_namez TestLoader._get_module_from_nameis���4�����{�4� � rc�"�t||��Sr)r)rr@r�rWs    r�_match_pathzTestLoader._match_pathms���t�W�%�%�%rc#�rK�|�|��}|dkr,||jvr#|�||��\}}|�|V�|sdStt	j|����}|D]�}tj�||��}|�||��\}}|�|V�|r�|�|��}|j�|��	|�	||��Ed{V��|j�
|����#|j�
|��wxYw��dS)z/Used by discovery. Yields test suites it loads.rrN)r�rH�_find_test_pathrar?�listdirr@rw�addr��discard)	rr�rWrrk�should_recurse�pathsr@r�s	         rr�zTestLoader._find_testsqsv�����'�'�	�2�2���3�;�;�4�t�'=�=�=�%)�$8�$8��G�$L�$L�!�E�>�� �����!�
����r�z�)�,�,�-�-���	9�	9�D�����Y��5�5�I�$(�$8�$8��G�$L�$L�!�E�>�� ������
9��/�/�	�:�:���&�*�*�4�0�0�0�9�#�/�/�	�7�C�C�C�C�C�C�C�C�C��*�2�2�4�8�8�8�8��D�*�2�2�4�8�8�8�8����
9�	9�	9s� D�D3c���tj�|��}tj�|���rt�|��sdS|�|||��sdS|�|��}	|�|��}tj�	t|d|����}ttj�|����}ttj�|����}|�
��|�
��kr�tj�|��}	ttj�|����}
tj�|��}d}t||
|	|fz���|�||���dfS#t"j$r"}
t'||
|j��dfcYd}
~
Sd}
~
wt+||j��\}}|j�|��|dfcYSxYwtj�|���rztj�tj�|d����sdSd}d}|�|��}	|�|��}t|dd��}|j�|��	|�||���}|�|df|j�|��S|d	f|j�|��S#|j�|��wxYw#t"j$r"}
t'||
|j��dfcYd}
~
Sd}
~
wt+||j��\}}|j�|��|dfcYSxYwdS)
z�Used by discovery.

        Loads tests from a single file, or a directories' __init__.py when
        passed the directory.

        Returns a tuple (None_or_tests_from_file, should_recurse).
        )NFr�zW%r module incorrectly imported from %r. Expected %r. Is this module globally installed?rVFNr�rZT)r?r@r�r��VALID_MODULE_NAME�matchr�r�r�r�rcrB�realpathr=r�r'rpr�SkipTestr;r(r*rFrer�rwrHr�r�)rr�rWr�rrg�mod_filer��fullpath_noext�
module_dir�mod_name�expected_dir�msgrmrnrorZrk�packages                   rr�zTestLoader._find_test_path�s����7�#�#�I�.�.��
�7�>�>�)�$�$�?	�$�*�*�8�4�4�
#�"�{��#�#�H�i��A�A�
#�"�{��+�+�I�6�6�D�
P��3�3�D�9�9���7�?�?��F�J�	�:�:�<�<��1��G�$�$�X�.�.�0�0��!7��G�$�$�Y�/�/�"1�"1���>�>�#�#�~�';�';�'=�'=�=�=�!#�����!:�!:�J�5���(�(��3�3� 5� 5�H�#%�7�?�?�9�#=�#=�L�D�C�%��x��\�B�B�D�D�D��/�/���/�H�H�%�O�O��/�=�
K�
K�
K�)�$��4�?�C�C�U�J�J�J�J�J�J�J�����
)�,�T�4�?�C�C�*�
�M���"�"�=�1�1�1�!�5�(�(�(�(����$�W�]�]�9�
%�
%�	��7�>�>�"�'�,�,�y�-�"H�"H�I�I�
#�"�{��J��E��+�+�I�6�6�D�
9��4�4�T�:�:��%�W�l�D�A�A�
��&�*�*�4�0�0�0�9� �4�4�W�g�4�N�N�E�!�-�$�e�|��*�2�2�4�8�8�8�8�!�$�;��*�2�2�4�8�8�8�8��D�*�2�2�4�8�8�8�8�����%�=�
K�
K�
K�)�$��4�?�C�C�U�J�J�J�J�J�J�J�����
)�,�T�4�?�C�C�*�
�M���"�"�=�1�1�1�!�5�(�(�(�(�����;sN�G*�*I�9H�I�;I�N�M%�M%�%N�O-�N0�*O-�0;O-r)r�N)rrr�__doc__r��staticmethodr�
three_way_cmpr�r�rrLr(r�rrUrpr�r�rOr�r�r�r�r�r�r�r r!s@rrDrDBsX�����������'�<��(:�;�;������J��N�'�'�'�'�'����$:>�*�*�*�*�*�XPJ�PJ�PJ�PJ�d'�'�'�'����&Q&�Q&�Q&�Q&�f
.�
.�
.�
�
�
�!�!�!�&�&�&�9�9�9�@H�H�H�H�H�H�HrrDc�^�t��}||_||_||_|r||_|Sr)rDr�r�r�r()�prefix�	sortUsingr(r��loaders     r�_makeLoaderr��s8��
�\�\�F�"+�F��$�F��.�F���'�&����Mrc��ddl}|jdtd���t|||����|��S)Nrz�unittest.getTestCaseNames() is deprecated and will be removed in Python 3.13. Please use unittest.TestLoader.getTestCaseNames() instead.���
stacklevel)r�)r\r]r^r�rO)rRr�r�r�r\s     rrOrO�sX���O�O�O��H�M�	E��q�����
�v�y�;K�L�L�L�]�]�^k�l�l�lrr/c��ddl}|jdtd���t|||���|��S)Nrz�unittest.makeSuite() is deprecated and will be removed in Python 3.13. Please use unittest.TestLoader.loadTestsFromTestCase() instead.r�r�)r\r]r^r�rU)rRr�r�r(r\s     r�	makeSuiter��sZ���O�O�O��H�M�	J��q�����
�v�y�*�5�5�K�K����rc��ddl}|jdtd���t|||���|��S)Nrz�unittest.findTestCases() is deprecated and will be removed in Python 3.13. Please use unittest.TestLoader.loadTestsFromModule() instead.r�r�)r\r]r^r�rp)rgr�r�r(r\s     r�
findTestCasesr��sZ���O�O�O��H�M�	H��q�����
�v�y�*�5�5�I�I����rrs)"r�r?�rer�r$rzr�r\rr�rrr�
__unittest�compile�
IGNORECASEr�r8r
r*r,r&r;rB�objectrD�defaultTestLoaderr�r�rOrLr�r�r2rr�<module>r�s�����	�	�	�	�	�	�	�	�
�
�
�
�����������������(�(�(�(�(�(�(�(�����������
�
�
�B�J�0�"�-�@�@�������$�-����N�N�N�
.�.�.�
(�(�(�0�0�0�%�%�%�W�W�W�W�W��W�W�W�t�J�L�L������7;�6H�[_�m�m�m�m�%+�d�6H���	�	�	�	�"(�4�3E�"�_�	�	�	�	�	�	r

Zerion Mini Shell 1.0