403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/_pytest/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/_pytest/__pycache__/python.cpython-312.pyc
�

��HgS��
���dZddlmZddlZddlmZddlmZddlZddlZddl	Z	ddl
mZddlZddl
Z
ddlZddlmZddlZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlZddl Z ddl m!Z!ddl m"Z"ddl#m$Z$ddl#m%Z%ddl&m'Z'ddl&m(Z(ddl&m)Z)ddl*m+Z+ddl,m-Z-ddl,m.Z.ddl,m/Z/ddl,m0Z0dd l,m1Z1dd!l,m2Z2dd"l,m3Z3dd#l,m4Z4dd$l,m5Z5dd%l,m6Z6dd&l7m8Z8dd'l7m9Z9dd(l:m;Z;dd)l<m=Z=dd*l>m?Z?dd+l>m@Z@dd,l>mAZAdd-l>mBZBdd.lCmDZDdd/lEmFZFdd0lEmGZGdd1lHmIZIdd2lHmJZJdd3lHmKZKdd4lHmLZLdd5lMmNZNdd6lMmOZOdd7lPmQZQdd8lPmRZRdd9lPmSZSdd:lPmTZTdd;lUmVZVdd<lUmWZWdd=lXmYZYdd>lZm[Z[dd?lZm\Z\dd@lZm]Z]erddAl^m_Z_dodB�Z`dpdD�ZadqdE�ZbdrdF�Zce9dG�H�dsdJ��Zd						dtdK�ZedudL�ZfdvdM�ZgdwdO�Zhe9dG�H�								dxdP��ZiGdQ�dRe"j��ZkGdS�dT�Zlemj�em�eoej�dU��hdV�eoel�eoel���Zq[lGdW�dXeke"j�ej��Zt				dydY�ZuGdZ�dNe"j�et�ZwGd[�d\e"j��Zydzd]�Zzd{d^�Z{Gd_�d`et�Z|d|da�Z}d|db�Z~eej�dG�c�Gdd�de���Z�eej�dG�c�Gdf�dg���Z�d}dh�Z�eYee�e?ef�Z�eGdi�dC��Z�								d~dj�Z�ddk�Z�Gdl�dIeke"�j�Z�Gdm�dne��Z�y)�z7Python test discovery, setup and run of test functions.�)�annotationsN)�Counter)�defaultdict)�partial)�Path)�Any)�Callable)�Dict)�final)�	Generator)�Iterable)�Iterator)�Literal)�Mapping)�Pattern)�Sequence)�
TYPE_CHECKING)�fixtures)�nodes)�filter_traceback)�getfslineno)�
ExceptionInfo)�TerminalRepr)�	Traceback)�saferepr)�
ascii_escaped)�get_default_arg_names)�
get_real_func)�	getimfunc)�is_async_function)�is_generator)�LEGACY_PATH)�NOTSET��safe_getattr)�safe_isclass)�Config)�hookimpl)�Parser)�check_ispytest)�
FixtureDef)�FixtureRequest)�FuncFixtureInfo)�get_scope_node)�Session)�MARK_GEN)�ParameterSet)�get_unpacked_marks)�Mark)�
MarkDecorator)�normalize_mark_list)�fail)�skip��
fnmatch_ex)�import_path)�ImportPathMismatchError)�scandir)�
_ScopeName)�Scope)�StashKey)�PytestCollectionWarning)�PytestReturnNotNoneWarning)�PytestUnhandledCoroutineWarning)�Selfc��|jddddgd��|jdddgd	��|jd
ddgd��|jd
ddd��y)N�python_files�argsz	test_*.pyz	*_test.pyz9Glob-style file patterns for Python test module discovery)�type�default�help�python_classes�Testz6Prefixes or glob names for Python test class discovery�python_functions�testzDPrefixes or glob names for Python test function and method discovery�Ddisable_test_id_escaping_and_forfeit_all_rights_to_community_support�boolFzcDisable string escape non-ASCII characters, might cause unwanted side effects(use at your own risk))�addini)�parsers �0C:\Python312\Lib\site-packages\_pytest/python.py�pytest_addoptionrSTs���
�M�M��
��k�*�
H����M�M��
���
E�	���M�M��
���
S�	���M�M�N�
��-�	���Metafuncc��|jjd��D],}|j|ji|j�d|i���.y)N�parametrize��name�_param_mark)�
definition�iter_markersrWrF�kwargs)�metafunc�markers  rR�pytest_generate_testsr`qsI���%�%�2�2�
�2�F�P������f�k�k�O�V�]�]�O��O�PrTc�L�|jdd�|jdd�y)N�markersa�parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see https://docs.pytest.org/en/stable/how-to/parametrize.html for more info and examples.z�usefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/stable/explanation/fixtures.html#usefixtures )�addinivalue_line)�configs rR�pytest_configurerevs1��
����	�
�����	S�rTc��d}|dz
}|dz
}|dz
}|dz
}|dz
}|dz
}tjt|j|���t	d�	�y)
NzFasync def functions are not natively supported and have been skipped.
zMYou need to install a suitable plugin for your async framework, for example:
z
  - anyio
z  - pytest-asyncio
z  - pytest-tornasync
z  - pytest-trio
z  - pytest-twistedz?async def function and no async plugin installed (see warnings))�reason)�warnings�warnrB�formatr7)�nodeid�msgs  rR�async_warn_and_skiprm�sp��
S�C��X��C��=��C��!�!�C��#�#�C����C����C��M�M�1�#�*�*�V�2D�E�F��Q�RrTT)�trylast�Functionc	��|j}t|�rt|j�|j}|j
jD�cic]}|||��
}}|di|��}t|d�st|d�rt|j�y|�/tjtd|j�d|�d���ycc}w)N�	__await__�	__aiter__zExpected None, but z
 returned zj, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?T�)�objr rmrk�funcargs�_fixtureinfo�argnames�hasattrrhrirA)�
pyfuncitem�testfunctionru�arg�testargs�results      rR�pytest_pyfunc_callr~�s����>�>�L���&��J�-�-�.��"�"�H�.8�.E�.E�.N�.N�O�s��X�c�]�"�O�H�O�
�
%�H�
%�F��v�{�#�w�v�{�'C��J�-�-�.��
�	��
�
�&�%�j�&7�&7�%8�
�6�*�M_�_�
�	
���Ps�
Cc��|dz}	|j�}|rtj||��Sy#t$rYywxYw)N�__init__.py��path)�is_file�PermissionError�Package�from_parent)r��parent�pkginit�has_pkginits    rR�pytest_collect_directoryr��sQ���]�"�G���o�o�'����"�"�6��"�5�5�������s�1�	=�=c��|jdk(rq|jj|�s&t||jjd��sy|jj
|�}|j||��}|Sy)Nz.pyrE��module_pathr�)�suffix�session�
isinitpath�path_matches_patternsrd�getini�gethookproxy�pytest_pycollect_makemodule)�	file_pathr��ihook�modules    rR�pytest_collect_filer��s{�����5� ��~�~�(�(��3�(��6�=�=�/�/��?������+�+�I�6���:�:�!�&�;�
���
�rTc�,��t�fd�|D��S)zKReturn whether path matches any of the patterns in the list of globs given.c3�6�K�|]}t|�����y�w�Nr8)�.0�patternr�s  �rR�	<genexpr>z(path_matches_patterns.<locals>.<genexpr>�s�����A�W�z�'�4�(�A�s�)�any)r��patternss` rRr�r��s����A��A�A�ArT�Modulec�0�tj||��S)Nr�)r�r�r�s  rRr�r��s�����f�;��7�7rTc��t|ttf�sJt|���t	|�r+|j||�rtj
|||��Sy|j||��rt|d|�}tj|�s_tjt|��sAt|�\}}tjtd|�d��dt!|�|dz��yt|dd�r�t#|�r_t$j
||�	�}d
|�d�}|j't)j*d|�
��|j-t|��|St/|j1||��Sy)N)rYrt�__func__zcannot collect z because it is not a function.�)�message�category�filename�lineno�__test__TrXz)yield tests were removed in pytest 4.0 - z will be ignoredF)�runrg)�
isinstance�Classr�rGr&�istestclassr��istestfunction�getattr�inspect�
isfunctionrrrh�
warn_explicitr@�strr!ro�
add_markerr0�xfailri�list�
_genfunctions)�	collectorrYrtr�r��resrgs       rR�pytest_pycollect_makeitemr��sj���i�%���1�B�4�	�?�B�1��C��� � ��d�+��$�$�Y�T�s�$�C�C�8�7
�	!�	!�#�t�	,��c�:�s�+���"�"�3�'�7�+=�+=�m�C�>P�+Q�*�3�/��H�f��"�"�/�%�d�X�-K�L����X����z�

�&��S�*�d�
+��C� ��*�*�9�4�*�@��?��v�EU�V�����x�~�~�%��G�H����0��8�9��
��I�3�3�D�#�>�?�?�rTc��eZdZdZdZed��Zed��Zed��Zed��Z	e	jd��Z	d�Zdd
d	�Zdd
�Z
y)�
PyobjMixinz�this mix-in inherits from Node to carry over the typing information

    as its intended to always mix in before a node
    its position in the mro is unaffectedTc�L�|jt�}|�|jSdS)z@Python module object this node was collected from (can be None).N)�	getparentr�rt��self�nodes  rRr�zPyobjMixin.modules&���~�~�f�%���+�t�x�x�5��5rTc�L�|jt�}|�|jSdS)z?Python class object this node was collected from (can be None).N)r�r�rtr�s  rR�clszPyobjMixin.clss&���~�~�e�$���+�t�x�x�5��5rTc��y)z�Python instance object the function is bound to.

        Returns None if not a test method, e.g. for a standalone test function,
        a class or a module.
        Nrs�r�s rR�instancezPyobjMixin.instance
s��rTc��t|dd�}|�}|j�x|_}|jrZ|jjt
|j��|jjd�|jD��|S)zUnderlying Python object.�_objNc3�8K�|]}|j|f���y�wr�rX�r��marks  rRr�z!PyobjMixin.obj.<locals>.<genexpr>#s����$T�4�d�i�i��%6�$T���)
r��_getobjr��_ALLOW_MARKERS�own_markers�extendr2rt�keywords�update�r�rts  rRrtzPyobjMixin.objsw���d�F�D�)���;�"�l�l�n�,�D�I���"�"�� � �'�'�(:�4�8�8�(D�E��
�
�$�$�$T�4�CS�CS�$T�T��
rTc��||_yr�)r�)r��values  rRrtzPyobjMixin.obj&s	����	rTc�v�|j�J�|jj}t||j�S)zCGet the underlying Python object. May be overwritten by subclasses.)r�rtr�rYr�s  rRr�zPyobjMixin._getobj*s2���{�{�&�&�&��k�k�o�o���s�D�I�I�&�&rTc�>�g}|j�D]h}|j}t|t�r9tj
j
|�d}|r|r|j|�n|j|��j|j�dj|�S)z5Return Python path relative to the containing module.r�.)
�iter_parentsrYr�r��osr��splitext�append�reverse�join)r��stopatmodule�
includemodule�partsr�rYs      rR�
getmodpathzPyobjMixin.getmodpath1s������%�%�'�	�D��9�9�D��$��'��w�w�'�'��-�a�0���$����T�*���L�L���	�	�
�
���x�x���rTc�\�t|j�\}}|j�}|||fSr�)rrtr�)r�r�r��modpaths    rR�
reportinfozPyobjMixin.reportinfo@s-��"�4�8�8�,���f��/�/�#���V�W�$�$rTN)TF)r�rOr�rO�returnr�)r�z.tuple[os.PathLike[str] | str, int | None, str])�__name__�
__module__�__qualname__�__doc__r��propertyr�r�r�rt�setterr�r�r�rsrTrRr�r��s���-�
�N�
�6��6�
�6��6�
��������	�Z�Z����'�
�%rTr�c��eZdZy)�_EmptyClassN)r�r�r�rsrTrRr�r�Ks�rTr��empty_module>�__file__�
__cached__�__builtins__c�L�eZdZd
d�Zdd�Zd
d�Zdd�Zdd�Zd
d�Zdd�Z	dd�Z
y	)�PyCollectorc�&�|jd|�S)NrL��_matches_prefix_or_glob_option�r�rYs  rR�funcnamefilterzPyCollector.funcnamefilter\s���2�2�3E�t�L�LrTc� �t|dd�duS)zgLook for the __test__ attribute, which is applied by the
        @nose.tools.istest decorator.
        r�FTr$r�s  rR�
isnosetestzPyCollector.isnosetest_s���C��U�3�t�;�;rTc�&�|jd|�S)NrJr�r�s  rR�classnamefilterzPyCollector.classnamefilterhs���2�2�3C�T�J�JrTc���|j|�s|j|�rGt|ttf�r
t|dd�}t
|�xrtj|�duSy)Nr�F)	r�r�r��staticmethod�classmethodr%�callabler�getfixturemarker�r�rtrYs   rRr�zPyCollector.istestfunctionksZ�����t�$�����(<��#��k�:�;�"�3�
�E�:���C�=�K�X�%>�%>�s�%C�t�%K�K�rTc�v�|j|�s|j|�sytj|�ryy)NFT)r�r�r��
isabstractrs   rRr�zPyCollector.istestclassts2���$�$�T�*�d�o�o�c�.B�����c�"��rTc��|jj|�D]:}|j|�ryd|vs	d|vsd|vs�#tj||�s�:yy)z`Check if the given name matches the prefix or glob-pattern defined
        in ini configuration.T�*�?�[F)rdr��
startswith�fnmatch)r��option_namerY�options    rRr�z*PyCollector._matches_prefix_or_glob_option{sa���k�k�(�(��5�		�F����v�&����-�3�&�=�C�6�M�w����f�H��		�rTc���t|jdd�sgSt|jdi�g}t|jt�r6|jjD]}|j|j��t�}g}|j}|D]�}g}t|j��D]n\}}	|tvr�||vr�|j|�|j|||	��}
|
��<t|
t�r|j|
��^|j|
��p|j|���g}t|�D]}|j|��|S)Nr�T�__dict__)r�rYrt)r�rtr�rG�__mro__r�r�setr�r��items�IGNORED_ATTRIBUTES�addr�r��reversed)r��dicts�basecls�seen�dict_valuesr��dic�valuesrYrtr�r}s            rR�collectzPyCollector.collect�sW���t�x�x��T�2��I�����:�r�2�3���d�h�h��%��8�8�+�+�
/�����W�-�-�.�
/�
���@B���
�
���	'�C�9;�F�"�#�)�)�+�.�
'�	��c��-�-���4�<��������5�5�"��3�6����;����T�*��M�M�#�&��M�M�#�&�
'�
���v�&�'	'�.���{�+�	"�F��M�M�&�!�	"��
rTc	#�:K�|jt�}|�J�|j}|jt�}|xr|jxsd}tj|||��}|j}t|||j||d��}	g}
t|d�r|
j|j�|�,t|d�r |
j|�j�|jjj|
t|	���|	jst j|||����y|j#�|	jD]=}|�d|j$�d�}t j|||||j$di|�	����?y�w)
N)rY�callobjT)r[�fixtureinfordr�r��	_ispytestr`)r^)rYr r
�])rY�callspecr r��originalname)r�r�rtr��FunctionDefinitionr�rvrUrdrxr�r`r��
call_extra�dict�_callsro�prune_dependency_tree�id)
r�rY�funcobj�	modulecolr��clscolr�r[r r^�methodsr#�subnames
             rRr�zPyCollector._genfunctions�s}�����N�N�6�*�	��$�$�$���������&���#����+�t��'�3�3�D�t�W�3�U�
� �-�-���!�#��;�;����

�����6�2�3��N�N�6�7�7�8��?�w�s�,C�D��N�N�3�5�6�6�7��
�
�(�(�3�3�G�T�8�=T�U�����&�&�t�$�K�&�P�P�
�-�-�/�$�O�O�	
��!�F�!�H�K�K�=��2���*�*�� �%� +�&�k�k�4�0�!%�
+���	
�s�FFN)rYr�r�rO�rt�objectr�rO)rtr1rYr�r�rO)r
r�rYr�r�rO�r�z&Iterable[nodes.Item | nodes.Collector])rYr�r�zIterator[Function])r�r�r�r�r�r�r�r�r�rr�rsrTrRr�r�[s-��M�<�K���
�)�V.rTr�c���|jd�}	t|||j|jd���}|j0j3|�|S#t$rG}t
jjtj�jd���|�d}~wt$r<}t
jjdj|j��|�d}~wt$r�}tj�}|j�dkr$|j j#t$�|_|j r|jd��n|j'�}t)|�}t
jjd|�d	|���|�d}~wt*j,$r2}|j.r�t
jjd
�|�d}~wwxYw)Nz
--import-mode�consider_namespace_packages)�mode�rootr4�short��stylez�import file mismatch:
imported module {!r} has this __file__ attribute:
  {}
which is not the same as the test file we want to collect:
  {}
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules�z)ImportError while importing test module 'zR'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
z�Using pytest.skip outside of a test will skip the entire module. If that's your intention, pass `allow_module_level=True`. If you want to skip a specific test or an entire class, use the @pytest.mark.skip or @pytest.mark.skipif decorators.)�	getoptionr:�rootpathr��SyntaxErrorr�	Collector�CollectErrorr�from_current�getreprr;rjrF�ImportError�
get_verbosity�	traceback�filterr�exconlyr�r7�	Exception�allow_module_level�
pluginmanager�consider_module)r�rd�
importmode�mod�e�exc_info�exc_repr�formatted_tbs        rR�importtestmodulerQ�s���
�!�!�/�2�J�-�������(.�
�
�6S�(T�	
��Z���(�(��-��J��Q���o�o�*�*��&�&�(�0�0�w�0�?�
��	��#�	��o�o�*�*�
@�
9�:@�����

I�
��	���� �-�-�/�����!�A�%�!)�!3�!3�!:�!:�;K�!L�H���!�!�
���7��+��!�!�#�	�
�8�}���o�o�*�*�7��v�>��n�
�
�
�	���>�>�������o�o�*�*�
K�
�
�	���s=�(A�	G$�!AB#�#G$�/7C&�&G$�2B*F�G$�2-G�G$c�:��eZdZdZd�Zd�fd�Zdd�Zdd�Z�xZS)r�z<Collector for test classes and functions in a Python module.c�B�t|j|j�Sr�)rQr�rdr�s rRr�zModule._getobj!s����	�	�4�;�;�7�7rTc���|j�|j�|jjj	|�t
�|��Sr�)�_register_setup_module_fixture� _register_setup_function_fixturer��_fixturemanager�parsefactories�superr�r��	__class__s �rRrzModule.collect$s@����+�+�-��-�-�/����$�$�3�3�D�9��w�� � rTc����t|jd��t|jd������yd	��fd�}|jjj	d|jj
��||jdd��y)
a"Register an autouse, module-scoped fixture for the collected module object
        that invokes setUpModule/tearDownModule if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        ��setUpModule�setup_module��tearDownModule�teardown_moduleNc3�h�K�|j}��t�|�d����
t�|�yy�wr�)r��_call_with_optional_argument)�requestr�r_rbs  ��rR�xunit_setup_module_fixturezIModule._register_setup_module_fixture.<locals>.xunit_setup_module_fixture;s8������^�^�F��'�,�\�6�B���*�,�_�f�E�+�s�/2�_xunit_setup_module_fixture_r�T�rY�funcrk�scope�autouse�r�zGenerator[None]��_get_first_non_fixture_funcrtr�rW�_register_fixturer�rk)r�rfr_rbs  @@rRrUz%Module._register_setup_module_fixture*s����3��H�H�5�
��6��H�H�;�
����O�$;��	F�	
���$�$�6�6�/����0A�0A�/B�C�+��;�;���
	7�	
rTc����t|jd��t|jd������yd	��fd�}|jjj	d|jj
��||jdd��y)
a*Register an autouse, function-scoped fixture for the collected module object
        that invokes setup_function/teardown_function if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        )�setup_function)�teardown_functionNc3��K�|j�d��y|j}��t�|�d����
t�|�yy�wr�)r��functionrd)rertrqrrs  ��rR�xunit_setup_function_fixturezMModule._register_setup_function_fixture.<locals>.xunit_setup_function_fixtureZsO��������+����'�'�H��)�,�^�X�F�� �,�,�->��I�-�s�AA�_xunit_setup_function_fixture_rtTrhrlrm)r�rurqrrs  @@rRrVz'Module._register_setup_function_fixtureLs����5�T�X�X�?R�S��7��H�H�,�
���!�&7�&?��	J�	
���$�$�6�6�1�$�(�(�2C�2C�1D�E�-��;�;���
	7�	
rTr2�r��None)	r�r�r�r�r�rrUrV�
__classcell__�r[s@rRr�r�s���F�8�!� 
�D"
rTc�L��eZdZdZ				d							d�fd�
Zdd�Zdd�Z�xZS)	r�a|Collector for files and directories in a Python packages -- directories
    with an `__init__.py` file.

    .. note::

        Directories without an `__init__.py` file are instead collected by
        :class:`~pytest.Dir` by default. Both are :class:`~pytest.Directory`
        collectors.

    .. versionchanged:: 8.0

        Now inherits from :class:`~pytest.Directory`.
    c�H��|j}t�|�	||||||��y)N)�fspathr�r�rdr�rk)r�rY�__init__)r�r}r�rdr�rkr�r[s       �rRr~zPackage.__init__�s2����.�.��
���������
	�	
rTc���t|jdz|j�}t|d�}|�t	||�t|d�}|�#tt||�}|j
|�yy)Nr�r]r`)rQr�rdrnrdr�addfinalizer)r��init_modr_rbris     rR�setupz
Package.setup�sy��#�D�I�I�
�$=�t�{�{�K��3��5�
���#�(��x�@�5��;�
���&��7��(�S�D����d�#�'rTc#�DK�dd�}|j}|j}t|j|�D]�}|j	�rat|j�}|jj|d��s|j||��r�Y|j||��}|��o|���t|j�s��t|j�}|jj|�s|j||��r��|j||��}|Ed{�����y7��w)Nc�8�|jdk7|jfS)Nr�rX)�entrys rR�sort_keyz!Package.collect.<locals>.sort_key�s���J�J�-�/����<�<rTT)�with_parents)�collection_pathrd)r�r�)r�r�)r�zos.DirEntry[str]r�r1)rdr�r<r��is_dirrr�r��pytest_ignore_collectr�r�r�)r�r�rdr��direntryr��col�colss        rRrzPackage.collect�s����	=������
�
����	�	�8�4�	 �H���� ��H�M�M�*���|�|�.�.�t�$�.�G��2�2�4�PV�2�W� ��4�4�$�t�4�L���?��I��!�!�#��H�M�M�*���|�|�.�.�t�4��2�2�4�PV�2�W� ��0�0�4��0�M�����!	 �  �s�B!D �$D �:AD �D�D )NNNN)r}zLEGACY_PATH | Noner��nodes.Collectorr�zPath | Noner�rxrwr2)r�r�r�r�r~r�rryrzs@rRr�r�qsK����&��� �
�"�
� �
��
�
�
�,$�$ rTr�c��|jj}tj|�r|dz}|r	||�y|�y)zyCall the given function with the given argument if func accepts one argument, otherwise
    calls func without arguments.r�N)�__code__�co_argcountr��ismethod)rir{�	arg_counts   rRrdrd�s9���
�
�)�)�I�������Q��	���S�	��rTc�d�|D]+}t||d�}|��tj|���)|cSy)z�Return the attribute from the given object to be used as a setup/teardown
    xunit-style function, but only if not marked as a fixture to avoid calling it twice.
    N)r�rr)rt�namesrY�meths    rRrnrn�sA�����%�c�4��6����� 9� 9�$� ?� G��K��rTc�V��eZdZdZedd�d	�fd��Zd�Zd
�fd�Zdd�Zdd�Z	�xZ
S)r�zBCollector for test methods (and nested classes) in a Python class.N�rtc�(��t�|�d||d�|��S)�The public constructor.)rYr�rs�rYr�)r�r�rYrt�kwr[s     �rRr�zClass.from_parent�s����w�"�B��V�B�r�B�BrTc�"�|j�Sr�r�r�s rR�newinstancezClass.newinstance�s���x�x�z�rTc	����t|jdd�sgSt|j�rY|j�J�|j	td|jj�d|jj�d���gSt|j�rY|j�J�|j	td|jj�d|jj�d���gS|j�|j�|jjj|j�|j�t�|�A�S)Nr�Tzcannot collect test class z. because it has a __init__ constructor (from: �)z- because it has a __new__ constructor (from: )r%rt�hasinitr�rir@r�rk�hasnew�_register_setup_class_fixture�_register_setup_method_fixturer�rWrXr�rYrrZs �rRrz
Class.collect�s2����D�H�H�j�$�7��I��4�8�8���;�;�*�*�*��I�I�'�0����1B�1B�0E�F3�37�;�;�3E�3E�2F�a�I��
��I�
�D�H�H�
��;�;�*�*�*��I�I�'�0����1B�1B�0E�F2�26�+�+�2D�2D�1E�Q�H��
��I��*�*�,��+�+�-����$�$�3�3�D�4D�4D�4F����T��w�� � rTc����t|jd��t|jd������yd	��fd�}|jjj	d|jj
��||jdd��y)
a!Register an autouse, class scoped fixture into the collected class object
        that invokes setup_class/teardown_class if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        )�setup_class)�teardown_classNc3��K�|j}��t��}t||�d����t��}t||�yy�wr�)r�rrd)rer�rir�r�s   ��rR�xunit_setup_class_fixturezFClass._register_setup_class_fixture.<locals>.xunit_setup_class_fixturesL������+�+�C��&� ��-��,�T�3�7���)� ��0��,�T�3�7�*�s�AA�_xunit_setup_class_fixture_�classTrhrl�rnrtr�rWror�rk)r�r�r�r�s  @@rRr�z#Class._register_setup_class_fixtures~���2�$�(�(�<L�M��4�T�X�X�?R�S����>�#9��	8�	
���$�$�6�6�.�t�x�x�/D�/D�.E�F�*��;�;���
	7�	
rTc�"�����d�t|j�f��d�t|j�f������yd	����fd�}|jjj	d|jj
��||jdd��y)
a'Register an autouse, function scoped fixture into the collected class object
        that invokes setup_method/teardown_method if either or both are available.

        Using a fixture to invoke these methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        �setup_method�teardown_methodNc3��K�|j}|j}��t|��}t||�d����t|��}t||�yy�wr�)r�rtr�rd)rer��methodrir��
setup_namer��
teardown_names    ����rR�xunit_setup_method_fixturezHClass._register_setup_method_fixture.<locals>.xunit_setup_method_fixture0s]������'�'�H��%�%�F��'��x��4��,�T�6�:���*��x��7��,�T�6�:�+�s�AA�_xunit_setup_method_fixture_rtTrhrlr�)r�r�r�r�r�r�s  @@@@rRr�z$Class._register_setup_method_fixture"s����$�
�2�4�8�8�j�]�K��)�
�5�d�h�h��@P�Q����O�$;��		;�		;�	
���$�$�6�6�/����0E�0E�/F�G�+��;�;���
	7�	
rT�r�rCr2rw)r�r�r�r�rr�r�rr�r�ryrzs@rRr�r��s1���L��.2�C��C��!�:
�> 
rTr�c�H�t|dd�}|r|tjk7Sy)Nr~F)r�r1r~)rt�inits  rRr�r�Es%���3�
�D�1�D���v���&�&�rTc�H�t|dd�}|r|tjk7Sy)N�__new__F)r�r1r�)rt�news  rRr�r�Ls%���#�y�$�/�C�
��f�n�n�$�$�rT)�frozenc��eZdZUdZdZded<ded<ded<d	ed
<ded<d
ed<d
ed<dd�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Ze
d d��Zy)!�IdMakerzMake IDs for a parametrization.)rw�
parametersets�idfn�idsrdrk�	func_name�
Sequence[str]rw�Sequence[ParameterSet]r�z%Callable[[Any], object | None] | Noner�zSequence[object | None] | Noner��
Config | Nonerd�
str | Nonerkr�c�
�t|j��}t|�tt|��k7r�t	|�}tt�}t|�D]w\}}||dkDs�d}|r|dj�rd}|�|�||��}|t|�vr&||xxdz
cc<|�|�||��}|t|�vr�&|||<||xxdz
cc<�yt|�tt|��k(s
Jd|����|S)a�Make a unique identifier for each ParameterSet, that may be used to
        identify the parametrization in a node ID.

        Format is <prm_1_token>-...-<prm_n_token>[counter], where prm_x_token is
        - user-provided id, if given
        - else an id derived from the value, applicable for certain types
        - else <argname><parameterset index>
        The counter suffix is appended only in case a string wouldn't be unique
        otherwise.
        r������_zInternal error: resolved_ids=)	r��_resolve_ids�lenrrr�int�	enumerate�isdigit)r��resolved_ids�	id_counts�id_suffixes�indexr*r��new_ids        rR�make_unique_parameterset_idsz$IdMaker.make_unique_parameterset_idsvs1���D�-�-�/�0���|���C��$5� 6�6���-�I�*5�c�*:�K�&�|�4�

)�	��r��R�=�1�$��F��b��f�n�n�.�!$�� "�t�F�8�K��O�+<�=�F� �C��$5�5�#�B��1�,��$&�4��x��B��/@�!A��!�C��$5�5�+1�L��'���O�q�(�O�

)��<� �C����%
�
�	.�
+�l�_�-�	.�
��rTc#���K�t�j�D]�\�}|j�|j���!�jrI�t	�j�kr1�j��"�j�j������vdj
��fd�t|j�j�D������y�w)z;Resolve IDs for all ParameterSets (may contain duplicates).N�-c3�J�K�|]\}}�j||�����y�wr�)�_idval)r��val�argname�idxr�s   ��rRr�z'IdMaker._resolve_ids.<locals>.<genexpr>�s*������$��W��K�K��W�c�2��s� #)
r�r�r*r�r��_idval_from_value_requiredr��ziprrw)r��parametersetr�s` @rRr�zIdMaker._resolve_ids�s������!*�4�+=�+=�!>�	��C�����*�"�o�o�%����c�C����M�1�d�h�h�s�m�6O��5�5�d�h�h�s�m�S�I�I��h�h��(+�L�,?�,?����(O����	�s�C
Cc��|j|||�}|�|S|j||�}|�|S|j|�}|�|S|j||�S)z-Make an ID for a parameter in a ParameterSet.)�_idval_from_function�_idval_from_hook�_idval_from_value�_idval_from_argname)r�r�r�r��idvals     rRr�zIdMaker._idval�sl���)�)�#�w��<�����L��%�%�c�7�3�����L��&�&�s�+�����L��'�'���5�5rTc�
�|j�y	|j|�}|�y|j|�S#t$rE}|j�|j�d�nd}d}||j||�z}t	|�|�d}~wwxYw)zjTry to make an ID for a parameter in a ParameterSet using the
        user-provided id callable, if given.N�: r�zJerror raised while trying to determine id of parameter '{}' at position {})r�rGrkrj�
ValueErrorr�)r�r�r�r�r*rM�prefixrls        rRr�zIdMaker._idval_from_function�s����9�9���	)����3��B��:���%�%�b�)�)���	)�+/�;�;�+B����}�B�'��F�^�C��3�:�:�g�s�3�3�C��S�/�q�(��		)�s�4�	B�AA=�=Bc��|jr4|jjj|j||��}|Sy)zsTry to make an ID for a parameter in a ParameterSet by calling the
        :hook:`pytest_make_parametrize_id` hook.)rdr�r�N)rd�hook�pytest_make_parametrize_id)r�r�r�r*s    rRr�zIdMaker._idval_from_hook�s@���;�;�!�[�[�-�-�H�H��{�{��W�I��B��I�rTc��t|ttf�rt||j�S|� t|t
tttf�rt|�St|t�rt|j�S|tur	yt|tj�rt|�Stt|dd�t�rt|d�}|Sy)zkTry to make an ID for a parameter in a ParameterSet from its value,
        if the value type is supported.Nr�)r�r��bytes�_ascii_escaped_by_configrd�floatr�rO�complexrrr�r#�enum�Enumr�)r�r�rYs   rRr�zIdMaker._idval_from_value�s����c�C��<�(�+�C����=�=�
�[�J�s�U�C��w�,G�H��s�8�O�
��W�
%� ����-�-�
�F�]���
��T�Y�Y�
'��s�8�O�
���Z��6��
<���Z�0�D��K�rTc��|j|�}|�|S|j�d|j�d�}n|j�d|j�d�}nd}|�dt|��dt	|��d|�d�}t|d	�
�y)zALike _idval_from_value(), but fails if the type is not supported.N�In r�r�zids contains unsupported value z (type: z) at index zf. Supported types are: str, bytes, int, float, complex, bool, enum, regex or anything with a __name__.F��pytrace)r�r�rkrrGr6)r�r�r�r*r�rls      rRr�z"IdMaker._idval_from_value_required�s���
�
#�
#�C�
(��
�>��I��>�>�%��4�>�>�*�"�-�F�
�[�[�
$��4�;�;�-�r�*�F��F��h�5�h�s�m�_�H�T�RU�Y�M�Yd�eh�di�js�
s�	�	
�S�%� rTc�0�t|�t|�zS)znMake an ID for a parameter in a ParameterSet from the argument name
        and the index of the ParameterSet.)r�)r�r�s  rRr�zIdMaker._idval_from_argname�s���7�|�c�#�h�&�&rTN)r��	list[str])r��
Iterable[str])r�r1r�r�r�r�r�r�)r�r1r�r�r�r�r�r�)r�r1r�r�r�r�)r�r1r�r�)r�r1r�r�r�r�)r�r�r�r�r�r�)r�r�r�r��	__slots__�__annotations__r�r�r�r�r�r�r�rr�rsrTrRr�r�Ssz��*��I���)�)�0�/�	'�'�
��
����!�F� 6�*� ��(!�&�'��'rTr�c�@�eZdZUdZej
e��Zded<ej
e��Z	ded<ej
e��Z
ded<ej
e��Zd	ed
<ej
e
��Zded<														dd
�Zdd�Zedd��Zy)�	CallSpec2z�A planned parameterized invocation of a test function.

    Calculated during collection for a given test function's Metafunc.
    Once collection is over, each callspec is turned into a single Item
    and stored in item.callspec.
    )�default_factoryzdict[str, object]�paramszdict[str, int]�indiceszMapping[str, Scope]�
_arg2scoper��_idlistz
list[Mark]�marksc
�h�|jj�}|jj�}t|j�}	t||�D]&\}
}|
|vrt
d|
����|||
<|||
<||	|
<�(t|||	g|j�|�g|j�t|����S)Nzduplicate parametrization of )rrrrr)r�copyrr'rr�r�r�rrr5)r�rw�valsetr*rrj�param_indexrr�	arg2scoper{r�s            rR�setmultizCallSpec2.setmultis������!�!�#���,�,�#�#�%������)�	��H�f�-�	#�H�C���f�}� �#@���!H�I�I��F�3�K�&�G�C�L�"�I�c�N�	#���� �'�d�l�l�'�B�'�<�D�J�J�<�!4�U�!;�<�
�	
rTc�\�	|j|S#t$r}t|�|�d}~wwxYwr�)r�KeyErrorr�)r�rYrMs   rR�getparamzCallSpec2.getparam/s3��	*��;�;�t�$�$���	*��T�"��)��	*�s��	+�&�+c�8�dj|j�S)Nr�)r�rr�s rRr*zCallSpec2.id5s���x�x����%�%rTN)rwr�rzIterable[object]r*r�rzIterable[Mark | MarkDecorator]rjr>rr�r�r�)rYr�r�r1)r�r�)r�r�r�r��dataclasses�fieldr'rr�rr�tuplerr�rr
r
r�r*rsrTrRr�r��s����!2�� 1� 1�$� G�F��G�/�k�/�/��E�G�^�E�&7�k�&7�&7��&M�J�#�M�.�[�.�.�u�E�G�]�E�)��)�)�$�?�E�:�?�
� �
�!�	
�

�
�.�

��
��
�
�
�6*��&��&rTr�c��|jSr�)�param)res rR�get_direct_param_fixture_funcr:s���=�=�rTc���eZdZdZ		ddd�									d
d�Z			ddd�													dd�Z										dd�Z								dd	�Z						dd
�Z						dd�Z	y)rUz�Objects passed to the :hook:`pytest_generate_tests` hook.

    They help to inspect a test function and to generate tests according to
    test configuration or values specified in the class or module where a
    test function is defined.
    NF�r!c���t|�||_||_||_|j|_|j|_||_|j|_
g|_yr�)r*r[rdr�rtrt�
names_closure�fixturenamesr��name2fixturedefs�_arg2fixturedefsr()r�r[r rdr�r�r!s       rRr~zMetafunc.__init__Ksd��	�y�!�%���������#����
�(�5�5������ +� <� <���(*��rT)rZc��tj|||j|j|jj
��\}}~d|vr
t
dd��|�/tj|d|jj����}nt||j|�}|j||�|r&|jr|jj}	|	�|	}|j||||jj
��}|r/|jr#	�!t j#|jd	|�d}
|tj$urx|jj&}|�J�t)||�}
|
�P|tj*urt-|t.�sJ�|}
n)|tj0ur
|j2}
n
Jd
|����|
�d}n"i}
|
j4j7t8|
�}|j;||�}|D]O}||dk(r�|�
||vr||}n(t=|jd|t>|ddd
��}|�|||<|g|j|<�Qg}|j@xstC�gD]^}tEtG||��D]D\}\}}|jI||jJ||jL||��}|jO|��F�`||_ y)a�Add new invocations to the underlying test function using the list
        of argvalues for the given argnames. Parametrization is performed
        during the collection phase. If you need to setup expensive resources
        see about setting indirect to do it rather than at test setup time.

        Can be called multiple times per test function (but only on different
        argument names), in which case each call parametrizes all previous
        parametrizations, e.g.

        ::

            unparametrized:         t
            parametrize ["x", "y"]: t[x], t[y]
            parametrize [1, 2]:     t[x-1], t[x-2], t[y-1], t[y-2]

        :param argnames:
            A comma-separated string denoting one or more argument names, or
            a list/tuple of argument strings.

        :param argvalues:
            The list of argvalues determines how often a test is invoked with
            different argument values.

            If only one argname was specified argvalues is a list of values.
            If N argnames were specified, argvalues must be a list of
            N-tuples, where each tuple-element specifies a value for its
            respective argname.
        :type argvalues: Iterable[_pytest.mark.structures.ParameterSet | Sequence[object] | object]
        :param indirect:
            A list of arguments' names (subset of argnames) or a boolean.
            If True the list contains all names from the argnames. Each
            argvalue corresponding to an argname in this list will
            be passed as request.param to its respective argname fixture
            function so that it can perform more expensive setups during the
            setup phase of a test rather than at collection time.

        :param ids:
            Sequence of (or generator for) ids for ``argvalues``,
            or a callable to return part of the id for each argvalue.

            With sequences (and generators like ``itertools.count()``) the
            returned ids should be of type ``string``, ``int``, ``float``,
            ``bool``, or ``None``.
            They are mapped to the corresponding index in ``argvalues``.
            ``None`` means to use the auto-generated id.

            If it is a callable it will be called for each entry in
            ``argvalues``, and the return value is used as part of the
            auto-generated id for the whole set (where parts are joined with
            dashes ("-")).
            This is useful to provide more specific ids for certain items, e.g.
            dates.  Returning ``None`` will use an auto-generated id.

            If no ids are provided they will be generated automatically from
            the argvalues.

        :param scope:
            If specified it denotes the scope of the parameters.
            The scope is used for grouping tests by parameter instances.
            It will also override any fixture-function defined scope, allowing
            to set a dynamic scope using test context or configuration.
        )rkrezK'request' is a reserved name and cannot be used in @pytest.mark.parametrizeFr�Nzparametrize() call in )�descr�_param_ids_generatedzUnhandled missing scope: �indirectr�T)rd�baseidr�rirjrr�r!)rwrr*rrjr)(r1�_for_parametrizertrdr[rkr6r>�	from_userr��_find_parametrized_scoper�_validate_if_using_arg_names�_param_ids_fromr�_resolve_parameter_set_idsr1�__setattr__ror�r.r�r�r�r�r��stash�
setdefault�name2pseudofixturedef_key�_resolve_args_directnessr+rr(r�r�r�r
rrr�)r�rw�	argvaluesrr�rjrZr��scope_�
generated_idsr�r��name2pseudofixturedefrH�arg_directnessr��
fixturedef�newcallsr#r�param_id�	param_set�newcallspecs                       rRrWzMetafunc.parametrizens��P#/�"?�"?����M�M��K�K��?�?�)�)�#
���-�
��� ��]��
�
���_�_��5�d�m�m�6L�6L�5M�N��F�.�h��8M�8M�x�X�F��)�)�(�H�=��;�6�6�'�7�7�L�L�M��(�#���-�-��c�=����1G�1G�.�
��
�;�6�6�=�;P����{�:�:�<R�TW�X�
��
����'����.�.�I��(�(�(�!�)�V�4�D��|��U�[�[�(�%�i��8�8�8�$�D��u�}�}�,�$�,�,�D�E�$=�e�W�"E�E�5��<�$(�!�24�G�$(�J�J�$9�$9�)�7�%�!��6�6�x��J���	:�G��g�&�*�4��$�0�W�@U�5U�2�7�;�
�'��;�;��#�6� ���"�	�
�)�4�5?�)�'�2�.8�\�D�!�!�'�*�%	:�.�����4�	��}�	-�H�6?��C��'�7�
-�2��2�h�	�'�/�/�%�$�+�+��#�/�/� � +�
0�������,�
-�	-���rTc	��|�d}d}n9t|�r|}d}n)d}|j|||jj�}t	|||||j
||jj��}|j
�S)a:Resolve the actual ids for the given parameter sets.

        :param argnames:
            Argument names passed to ``parametrize()``.
        :param ids:
            The `ids` parameter of the ``parametrize()`` call (see docs).
        :param parametersets:
            The parameter sets, each containing a set of values corresponding
            to ``argnames``.
        :param nodeid str:
            The nodeid of the definition item that generated this
            parametrization.
        :returns:
            List with ids for each parameter set given.
        N)rkr�)r�
_validate_idsrtr�r�rdr�)r�rwr�r�rkr��ids_�id_makers        rRr&z#Metafunc._resolve_parameter_set_ids#s���,�;��D��D�
�c�]��D��D��D��%�%�c�=�$�-�-�:P�:P�Q�D�������K�K���m�m�,�,�
���4�4�6�6rTc�X�	t|�}|t|�k7r.|dk7r)d}t|j	|t|�|�d��tt
j||��S#t$r8	t|�n#t$r}td�|�d}~wwxYwt|�}Y��wxYw)Nz%ids must be a callable or an iterablerzDIn {}: {} parameter sets specified, with different number of ids: {}Fr�)r��	TypeError�iterr6rjr��	itertools�islice)r�r�r�r��num_idsrMrls       rRr7zMetafunc._validate_idsMs���	)��#�h�G��c�-�(�(�W��\�X�C�����I�s�=�'9�7�C�U�S��I�$�$�S�'�2�3�3���	)�
P��S�	���
P�� G�H�a�O��
P���-�(�G�	)�s5�A(�(	B)�2A>�=B)�>	B�B�B�B)�(B)c��t|t�r"tj||rd�}|Sd�}|St|t�rPtj|d�}|D]3}||vr(td|jj�d|�d�d��d||<�5|Std|jj�dt|�j��d��S)	aResolve if each parametrized argument must be considered an indirect
        parameter to a fixture of the same name, or a direct parameter to the
        parametrized function, based on the ``indirect`` parameter of the
        parametrized() call.

        :param argnames:
            List of argument names passed to ``parametrize()``.
        :param indirect:
            Same as the ``indirect`` parameter of ``parametrize()``.
        :returns
            A dict mapping each arg name to either "indirect" or "direct".
        r�directr�z: indirect fixture 'z' doesn't existFr�z1: expected Sequence or boolean for indirect, got )	r�rOr'�fromkeysrr6rtr�rG)r�rwrr0r{s     rRr+z!Metafunc._resolve_args_directnesscs���$�h��%�!�]�]���*��N�$��#7?��N�$����(�
+�!�]�]�8�X�>�N��
1���h�&���d�m�m�4�4�5�5I�#��o�^� %��'1��s�#�

1���
��d�m�m�,�,�-�.&�&*�8�n�&=�&=�%>�@��
�
�rTc
�6�tt|j��}|jj}|D]`}||jvs�||vrtd|�d|�d�d���+t
|t�r	||vrdnd}n|rdnd}td|�d|�d	|�d
�d���by)a4Check if all argnames are being used, by default values, or directly/indirectly.

        :param List[str] argnames: List of argument names passed to ``parametrize()``.
        :param indirect: Same as the ``indirect`` parameter of ``parametrize()``.
        :raises ValueError: If validation fails.
        r�z&: function already takes an argument 'z' with a default valueFr��fixture�argumentz: function uses no z '�'N)rrrtr�rr6r�r)r�rwr�default_arg_namesr�r{rYs       rRr$z%Metafunc._validate_if_using_arg_names�s��� � 5�d�m�m� D�E���M�M�*�*�	��	�C��$�+�+�+��+�+���i�[�(N�s�e�Si�j� %��
"�(�H�5�,/�8�O�y���,4�y�*����i�[�(;�D�6��C�5��J� %��	rT)NN)
r[r%r zfixtures.FuncFixtureInfordr'r!rOr�rx)FNN)rwzstr | Sequence[str]r,z2Iterable[ParameterSet | Sequence[object] | object]r�bool | Sequence[str]r��?Iterable[object | None] | Callable[[Any], object | None] | Nonerjz_ScopeName | NonerZzMark | Noner�rx)
rwr�r�rIr�r�rkr�r�r�)r�zIterable[object | None]r�r�r�r�r�zlist[object | None])rwr�rrHr�z(dict[str, Literal['indirect', 'direct']])rwr�rrHr�rx)
r�r�r�r�r~rWr&r7r+r$rsrTrRrUrUBs^���
��
!*� �!*�&�!*�.�!*��	!*��!*�
�!*�N*/�OS�#'�
s�$(�s�%�s�F�s�'�	s�
M�s�!�
s�!�s�
�s�j(7��(7�M�(7�.�	(7�
�(7�
�
(7�T4�
$�4�.�4��	4�

�4�,%��%�'�%�
2�	%�N���'��
�	rTc�@�t|t�rt|�t|�k(}nt|�}|rT|xsi}|j	�D��cgc]\}}||vr|dj
��}}}t
|tj��StjScc}}w)a}Find the most appropriate scope for a parametrized call based on its arguments.

    When there's at least one direct argument, always use "function" scope.

    When a test function is parametrized and all its arguments are indirect
    (e.g. fixtures), return the most narrow scope based on the fixtures used.

    Related to issue #1832, based on code posted by @Kingdread.
    r�)rH)	r�rr�rOr�_scope�minr>ro)rw�arg2fixturedefsr�all_arguments_are_fixtures�fixturedefsrYr1�used_scopess        rRr#r#�s����(�H�%�%(��]�c�(�m�%C�"�%)�(�^�"�!�%�+���%0�$5�$5�$7�
� ��j��x��
�r�N�!�!�
��
��;����7�7��>�>���
s�Bc�L�|�d}n|jd�}|r|St|�S)NFrN)r�r)r�rd�
escape_options   rRr�r��s1��
�~��
��
�
�R�
�
� �3�7�]�3�%7�7rTc����eZdZdZdZddeddddf															d�fd�
Zed�fd��Zdd�Z	e
d��Ze
d��Zd	�Z
d
�Ze
d��Zdd�Zdd
�Zdd�Z				dd�Z�xZS)roa�Item responsible for setting up and executing a Python test function.

    :param name:
        The full function name, including any decorations like those
        added by parametrization (``my_func[my_param]``).
    :param parent:
        The parent Node.
    :param config:
        The pytest Config object.
    :param callspec:
        If given, this function has been parametrized and the callspec contains
        meta information about the parametrization.
    :param callobj:
        If given, the object which will be called when the Function is invoked,
        otherwise the callobj will be obtained from ``parent`` using ``originalname``.
    :param keywords:
        Keywords bound to the function object for "-k" matching.
    :param session:
        The pytest Session object.
    :param fixtureinfo:
        Fixture information already resolved at this fixture node..
    :param originalname:
        The attribute name to use for accessing the underlying function object.
        Defaults to ``name``. Set this if name is different from the original name,
        for example when it contains decorations like those added by parametrization
        (``my_func[my_param]``).
    FNc
���t�|�||||��|tur||_t	|dd�|_|	xs||_|jjt|j��|r,||_|jj|j�|jjd�|jD��|jj|jj�|r|jj|�|�=|j j"}
|
j%||j|j&�}||_|j*|_|j/�y)N)rdr��__self__c3�8K�|]}|j|f���y�wr�rXr�s  rRr�z$Function.__init__.<locals>.<genexpr>s����L�4�d�i�i��.�L�r�)rYr~r#r�r��	_instancer$r�r�r2rtr#rr�r�rr�rW�getfixtureinfor�rvrr�_initrequest)r�rYr�rdr#rr�r�r r$�fmr[s           �rRr~zFunction.__init__�s/���	����v�f�g��F��&� ��D�I�$�W�j�$�?�D�N�)�0�D���
	
����� 2�4�8�8� <�=��$�D�M����#�#�H�N�N�3�	
�
�
���L�4�;K�;K�L�L��
�
���T�X�X�.�.�/���M�M� � ��*������-�-�B��+�+�D�$�(�(�D�H�H�E�K�-8���'�5�5������rTc�&��t�|�dd|i|��S)r�r�rsr�)r�r�r�r[s   �rRr�zFunction.from_parent*s����w�"�7�&�7�B�7�7rTc�J�i|_tj|d��|_y)NTr)rur�
TopRequest�_requestr�s rRrYzFunction._initrequest/s��+-��
� �+�+�D�D�A��
rTc�,�t|j�S)z$Underlying python 'function' object.)rrtr�s rRrtzFunction.function3s������"�"rTc��	|jS#t$rEt|jt�r|j�|_nd|_Y|jSwxYwr�)rW�AttributeErrorr�r�r��_getinstancer�s rRr�zFunction.instance8sP��	&��>�>�!���	&��$�+�+�u�-�!%�!2�!2�!4���!%�����~�~��
	&�s��AA�Ac�l�t|jt�r|jj�Syr�)r�r�r�r�r�s rRrbzFunction._getinstanceDs&���d�k�k�5�)��;�;�*�*�,�,�rTc��|j}|�|}n$|j�J�|jj}t||j�Sr�)r�r�rtr�r$)r�r��
parent_objs   rRr�zFunction._getobjKsF���=�=����!�J��;�;�*�*�*������J��z�4�#4�#4�5�5rTc��|S)zA(compatonly) for code expecting pytest-2.2 style request objects.rsr�s rR�_pyfuncitemzFunction._pyfuncitemTs	���rTc�<�|jj|��y)z%Execute the underlying test function.)ryN)r�r~r�s rR�runtestzFunction.runtestYs���
�
�%�%��%�6rTc�8�|jj�yr�)r^�
_fillfixturesr�s rRr�zFunction.setup]s���
�
�#�#�%rTc��t|d��r&|jjdd��s	tjj
j
t|j��}|j|j}}|j}|j||��}||k(r0|j|��}||k(r|jt�}|s|}|j|�}|jjdd�dk(r/t|�dkDr!t!|d	gd
�|ddD��|d���}|S|jS)
Nr��	fulltraceF)r��firstlinenor��tbstyle�autor:rc3�>K�|]}|jd����y�w)r7N)�with_repr_style)r��ts  rRr�z-Function._traceback_filter.<locals>.<genexpr>us����S�Q�a�/�/��8�S�s�r�r�)rxrdr;�_pytest�_code�Code�
from_functionrrtr�rnrD�cutrErr�r)r��excinfo�coder�rnrD�
ntracebacks       rR�_traceback_filterzFunction._traceback_filter`s.���4�� ����)>�)>�{�E�)R��=�=�%�%�3�3�M�$�(�(�4K�L�D� $�	�	�4�+;�+;�+�D��)�)�I�"���D�k��J�J��Y�&�'�^�^��^�6�
���*�!+�!2�!2�3C�!D�J�%�%.�
�#�*�*�7�3�J��{�{�$�$�Y��7�6�A��z�?�Q�&�!*�&�q�M��S�*�Q�r�BR�S��'�r�N��"�J���� � � rTc�n�|jjdd�}|dk(rd}|j||��S)Nrorp�longr8)rdr;�_repr_failure_py)r�ryr9s   rR�repr_failurezFunction.repr_failure~s<�����%�%�i��8���F�?��E��$�$�W�E�$�:�:rT)rYr�rdr�r#zCallSpec2 | Noner�zMapping[str, Any] | Noner�zSession | Noner zFuncFixtureInfo | Noner$r�r�rxr�rw)ry�ExceptionInfo[BaseException]r�r)ryr�r�zstr | TerminalRepr)r�r�r�r�r�r#r~rr�rYr�rtr�rbr�rgrir�r|r�ryrzs@rRroro�s����:�N�!%�%)��-1�"&�.2�#'�1��1��	1�
#�1�+�1� �1�,�1�!�1�
�1�h�8��8�B��#��#��	��	��6�����7�&�!�<;�-�;�
�;rTc��eZdZdZdd�ZeZy)r%z�This class is a stop gap solution until we evolve to have actual function
    definition nodes and manage to get rid of ``metafunc``.c��td��)Nz8function definitions are not supposed to be run as tests)�RuntimeErrorr�s rRrizFunctionDefinition.runtest�s���U�V�VrTNrw)r�r�r�r�rir�rsrTrRr%r%�s��?�W�
�ErTr%)rQr)r�rx)r^rUr�rx)rdr'r�rx)rkr�r�rx)ryror��
object | None)r�rr�r�r�znodes.Collector | None)r�rr�r�r�z
Module | None)r�rr�r�r�rO)r�rr�r�)r�zModule | ClassrYr�rtr1r�zHNone | nodes.Item | nodes.Collector | list[nodes.Item | nodes.Collector])r�rrdr'rw)rtr1r�r�r�r�r0)rer,r�r)rwr�rMz3Mapping[str, Sequence[fixtures.FixtureDef[object]]]rrHr�r>)r�zstr | bytesrdr�r�r�)�r��
__future__r�abc�collectionsrrrr�r�	functoolsrr�r=r��pathlibr�types�typingrr	r
rrr
rrrrrrrhrtrr�
_pytest._coderr�_pytest._code.coderrr�_pytest._io.safereprr�_pytest.compatrrrrr r!r"r#r%r&�_pytest.configr'r(�_pytest.config.argparsingr)�_pytest.deprecatedr*�_pytest.fixturesr+r,r-r.�_pytest.mainr/�_pytest.markr0r1�_pytest.mark.structuresr2r3r4r5�_pytest.outcomesr6r7�_pytest.pathlibr9r:r;r<�
_pytest.scoper=r>�
_pytest.stashr?�_pytest.warning_typesr@rArB�typing_extensionsrCrSr`rermr~r�r�r�r�r��Noder�r��	frozenset�union�dir�
ModuleTyperr>�ABCr�rQ�Filer��	Directoryr�rdrnr�r�r��	dataclassr�r�rr�r*rUr#r��Itemror%rsrTrR�<module>r�sM��=�"�
��#�������	�������������� �����*�%�,�+�(�)�(�0�(�$�,�'�&�!�'�'�!�#�,�-�'�+�,�+� �!�%�6�(�1�7�!�!�&�'�3�#�$��"�9�<�A��&��:P�
�(S�
�$�����&�
��'�����B�
8�
�$��#��#�%(�#�/5�#�M�#��#�LK%����K%�d���_�_�
�K�������(�)�.������
��
���H�*�e�o�o�s�w�w�H�V5�
�5��5�pP
�U�Z�Z��P
�fP �e�o�o�P �f	��g
�K�g
�T�������d�#�f'�f'�$��f'�R�����d�#�7&�7&�$��7&�t�
A�H�T�#�z�#��*>�%?�@�B���c�c��c�L���H��#���	�@
8�o;�z�5�:�:�o;�d��rT

Youez - 2016 - github.com/yon3zu
LinuXploit