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 :  /Python312/Lib/site-packages/_pytest/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

��HgN�	��ddlmZddlZddlmZddlmZddlZddlZddlZddl	Z	ddl
mZddlZddl
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddl%Z%ddl&Z&ddl&m'Z'ddl(m)Z)ddl(m*Z*ddl+m,Z,dd l+m-Z-dd!l.m/Z/dd"l0m1Z1dd#l0m2Z2dd$l0m3Z3dd%l0m4Z4dd&l0m5Z5dd'l0m6Z6dd(l0m7Z7dd)l0m8Z8dd*l0m9Z9dd+l0m:Z:dd,l0m;Z;dd-l0m<Z<dd.l=m>Z>dd/l=m?Z?dd0l=m@Z@dd1lAmBZBdd2lCmDZDdd3lCmEZEdd4lCmFZFdd5lGmHZHdd6lImJZJdd7lImKZKdd8lLmMZMdd9lNmOZOdd:lNmPZPdd;lNmQZQdd<lRmSZSdd=lRmTZTdd>lUmVZVdd?lUmWZWdd@lUmXZXej�dAkrddBlZm[Z[e"rddCl\m]Z]ddDl\m^Z^ddEl\m_Z_e#dF�Z`e#dGedHeaf�I�Zbe$edHe`fedHee`ddfffZce$e!e`eadfe!deae!edee
j�fffZfej�dJ�K�GdL�dMee`��Zhd�dO�Zi						d�dP�Zjd�dQ�Zkd�dR�Zlej�dJ�K�GdS�dT��Zme#dU�ZneendfZo						d�dV�Zpd�dW�Zq										d�dX�Zrej�dJ�K�GdY�dZ��ZsGd[�d\ej��ZueGd]�d^eu��ZveGd_�d`eu��ZweGda�dbex��ZyGdc�dde-�Zz						d�de�Z{d�df�Z|								d�dg�Z}eGdh�diee`��Z~						d�dj�Z						d�dk�Z�						d�dn�Z�eej�dJ�K�Gdo�dm���Z�edHdHdHdHdHdp�													d�dq��Z�e	d�dHdHdHdHddp�													d�dr��Z�	d�dlddsdddp�													d�dt�Z�	d�dlddsdddp�du�Z�e�dN�v�d�dw��Z�d�dx�Z�d�dy�Z�d�dz�Z�d�d{�Z�Gd|�d}�Z�d�d~�Z�ee&�j��jZ�d�d�Z�d�d��Z�d�d��Z�d�d��Z�d�d�d��Z�y)��)�annotationsN)�defaultdict)�deque)�Path)�AbstractSet)�Any)�Callable)�cast)�Dict)�Final)�final)�	Generator)�Generic)�Iterable)�Iterator)�Mapping)�MutableMapping)�NoReturn)�Optional)�OrderedDict)�overload)�Sequence)�Tuple)�
TYPE_CHECKING)�TypeVar)�Union)�nodes)�getfslineno)�Source)�FormattedExcinfo)�TerminalRepr)�TerminalWriter)�_PytestWrapper)�assert_never)�
get_real_func)�get_real_method)�getfuncargnames)�	getimfunc)�getlocation)�is_generator)�NOTSET)�
NotSetType)�safe_getattr)�safe_isclass)�
_PluggyPlugin)�Config)�ExitCode)�Parser��check_ispytest)�MARKED_FIXTURE)�
YIELD_FIXTURE)�Session)�Mark)�ParameterSet)�
MarkDecorator��fail)�skip)�TEST_OUTCOME)�absolutepath)�bestrelpath)�
_ScopeName)�HIGH_SCOPES)�Scope)��)�BaseExceptionGroup)�	CallSpec2)�Function)�Metafunc�FixtureValue�FixtureFunction.)�boundT)�frozenc�"�eZdZUded<ded<y)�PseudoFixtureDefz"_FixtureCachedResult[FixtureValue]�
cached_resultrC�_scopeN��__name__�
__module__�__qualname__�__annotations__���2C:\Python312\Lib\site-packages\_pytest/fixtures.pyrOrOss
��5�5��MrXrO�sessionc�$�t|�|_y�N)�FixtureManager�_fixturemanager)rZs rY�pytest_sessionstartr_ys��,�W�5�G�rXc��ddlm}|j�D],}t||�s�|j|j
k(s�*|cS|jS)Nr)�Package)�_pytest.pythonra�iter_parents�
isinstance�nodeid�baseidrZ)�node�
fixturedefra�parents    rY�get_scope_packagerj}sK��'��#�#�%����f�g�&�6�=�=�J�<M�<M�+M��M���<�<�rXc�<�ddl}|tjur|jtj
�S|tjur%|j|jj�S|tjur%|j|jj�S|tjur%|j|jj�S|tjur%|j|jj�St|�y�Nr)
rbrCrH�	getparentr�Item�Class�python�Modulerar7�mainr$)rg�scope�_pytests   rY�get_scope_noderu�s����������~�~�e�j�j�)�)�	�%�+�+�	��~�~�g�n�n�2�2�3�3�	�%�,�,�	��~�~�g�n�n�3�3�4�4�	�%�-�-�	��~�~�g�n�n�4�4�5�5�	�%�-�-�	��~�~�g�l�l�2�2�3�3��U�rXc�F�tttt|dd��S)zJReturn fixturemarker or None if it doesn't exist or raised
    exceptions.�_pytestfixturefunctionN)r
r�FixtureFunctionMarkerr-)�objs rY�getfixturemarkerrz�s'����&�'��S�2�D�9��rXc�6�eZdZUded<ded<ded<ded<y	)
�
FixtureArgKey�str�argname�int�param_indexzPath | None�scoped_item_path�type | None�item_clsNrRrWrXrYr|r|�s��
�L���!�!��rXr|�_Vc#�K�|tjusJ�	|j}d}|tjurd}n~|tj
ur|jj}nU|tjur
|j}n6|tjur|j}|j}nt|�|jD]4}|j||k7r�|j|}t|||����6y#t$rYywxYw�w)zWReturn list of keys for all parametrized arguments which match
    the specified scope.N)rCrH�callspec�AttributeErrorr7ra�pathrirqro�clsr$�indices�
_arg2scoper|)�itemrsr�r�r�r~r�s       rY� get_parametrized_fixture_argkeysr��s�����
����&�&�&��"�m�m���H���
�
����	�%�-�-�	��9�9�+�+��	�%�,�,�	��9�9��	�%�+�+�	��9�9���8�8���U���#�#�N�����w�'�5�0���&�&�w�/���G�[�2B�H�M�M�	N��#����s(�D�C=�CD�=	D	�D�D	�	Dc�D�i}i}tD]Z}ix}||<tt�x}||<|D]8}tj	t||��}|s�%|||<|D]
}d|||<��:�\tj	|�}	t
t|	||tj��Sr\)
rBrr�dict�fromkeysr��list�reorder_items_atscoperCr7)
�items�argkeys_by_item�items_by_argkeyrs�scoped_argkeys_by_item�scoped_items_by_argkeyr��argkeys�argkey�	items_sets
          rY�
reorder_itemsr��s���PR�O�	���@��:<�<����!7�:E�k�:R�R����!7��	@�D��m�m�$D�T�5�$Q�R�G��/6�&�t�,�%�@�F�;?�*�6�2�4�8�@�		@�@��
�
�e�$�I���������	
��rXc���|tjust|�dkr|S||}||}t��t	|�}i}|�r2i}d}	|r�|j�}
|
|vs|
|vr�tj�fd�|j|
d�D��}|sd||
<n�|j�\}	}||	D�
cgc]	}
|
|vs�|
��}}
t|�D][}
|j|
�tD]?}||}||j|
d�D] }d|||
<||j|
d���"�A�]n|r��|r-t||||j��}|j!|�|	��j#|	�|r��2|Scc}
w)NrDc3�,�K�|]}|�vs�|���
y�wr\rW)�.0�k�ignores  �rY�	<genexpr>z(reorder_items_atscope.<locals>.<genexpr>s�����$��1�F�?��$�s�	�rWF)�last)rCrH�len�setr�popleftr�r��get�popitem�reversed�
appendleftrB�move_to_endr��
next_lower�update�add)r�r�r�rsr�r��items_deque�
items_done�no_argkey_items�slicing_argkeyr�r��_�i�matching_items�other_scope�other_scoped_items_by_argkeyr��reordered_no_argkey_itemsr�s                   @rYr�r��s����
�����#�e�*�q�.���,�U�3��,�U�3��!$��F���,�K�)+�J�
�24������&�&�(�D��z�!�T�_�%<���m�m�$�1�5�5�d�B�?�$��G��(,���%�$+�O�O�$5�!��� 6�n�E�"���e��A�"��"�"�.�1�	�A��*�*�1�-�'2���7F�{�7S�4�&5�k�&B�&F�&F�q�"�&M��F�FJ�8��@��C�8��@�L�L� !��M����	��5�6�(=���/�5�CS�CS�CU�)�%�
���7�8��%��J�J�~�&�I�J���+"s�7	E<�E<c�F�eZdZUdZdZded<ded<ded<ded	<dd
�Zy)
�FuncFixtureInfoa�Fixture-related information for a fixture-requesting item (e.g. test
    function).

    This is used to examine the fixtures which an item requests statically
    (known during collection). This includes autouse fixtures, fixtures
    requested by the `usefixtures` marker, fixtures requested in the function
    parameters, and the transitive closure of these.

    An item may also request fixtures dynamically (using `request.getfixturevalue`);
    these are not reflected here.
    )�argnames�initialnames�
names_closure�name2fixturedefs�tuple[str, ...]r�r��	list[str]r��$dict[str, Sequence[FixtureDef[Any]]]r�c��t�}t|j�}|ro|j�}||vrX||jvrJ|j	|�||j
vr+|j
|j
|dj�|r�ot||jj��|jddy)a�Recompute names_closure from initialnames and name2fixturedefs.

        Can only reduce names_closure, which means that the new closure will
        always be a subset of the old one. The order is preserved.

        This method is needed because direct parametrization may shadow some
        of the fixtures that were included in the originally built dependency
        tree. In this way the dependency tree can get pruned, and the closure
        of argnames may get reduced.
        ���)�keyN)
r�r��popr�r�r�r�r��sorted�index)�self�closure�working_setr~s    rY�prune_dependency_treez%FuncFixtureInfo.prune_dependency_treeGs��� �E���$�+�+�,���!�o�o�'�G��g�%�'�T�5G�5G�*G����G�$��d�3�3�3��&�&�t�'<�'<�W�'E�b�'I�'R�'R�S��!'�w�D�4F�4F�4L�4L� M����1�rXN��return�None)rSrTrU�__doc__�	__slots__rVr�rWrXrYr�r�(s5��
�R�I���"�!���
;�:�NrXr�c���eZdZdZdd�											dd�Zedd��Zeejdd���Z	edd��Z
ej						d d��Zed!d	��Zeejd
���Z
ed"d��Zed��Zed
��Zed��Zed��Zed#d��Zed$d��Zed%d��Zejd&d��Zd'd�Zd(d�Zd)d�Zd*d�Z				d+d�Zd,d�Zd-d�Zy).�FixtureRequestz�The type of the ``request`` fixture.

    A request object gives access to the requesting test context and has a
    ``param`` attribute in case the fixture is parametrized.
    F��	_ispytestc�V�t|�||_||_||_||_|yr\)r4�fixturename�_pyfuncitem�_arg2fixturedefs�
_fixture_defs)r��
pyfuncitemr��arg2fixturedefs�fixture_defsr�s      rY�__init__zFixtureRequest.__init__js5��	�y�!�"-���",���
(7���%1���	
rXc�B�|jjjSr\)r�rZr^�r�s rYr^zFixtureRequest._fixturemanager�s�����'�'�7�7�7rXc��t��r\��NotImplementedErrorr�s rYrQzFixtureRequest._scope�s
��"�#�#rXc�.�|jjS�zIScope string, one of "function", "class", "module", "package", "session".�rQ�valuer�s rYrszFixtureRequest.scope�����{�{� � � rXc��t��r\r��r��requested_fixturedef�requested_scopes   rY�_check_scopezFixtureRequest._check_scope��
��"�#�#rXc��t|jj�}|jt	|j
�j
|��|S)z-Names of all active fixtures in this request.)r�r��fixturenames�extendr�r��
difference)r��results  rYr�zFixtureRequest.fixturenames�sA���d�&�&�3�3�4���
�
�c�$�,�,�-�8�8��@�A��
rXc��t��)z>Underlying collection node (depends on current request scope).r�r�s rYrgzFixtureRequest.node��
��"�#�#rXc�.�|jjS)z6The pytest config object associated with this request.)r��configr�s rYr�zFixtureRequest.config�s�����&�&�&rXc�~�|jdk7rtd|j�d���|jjS)z=Test function object if the request has a per-function scope.�functionzfunction not available in �-scoped context)rsr�r�ryr�s rYr�zFixtureRequest.function�sA���:�:��#� �,�T�Z�Z�L��H��
����#�#�#rXc���|jdvrtd|j�d���|jjtj
j�}|r|jSy)z:Class (can be None) where the test function was collected.)�classr�zcls not available in r�N)rsr�r�rmrtrprory)r��clscols  rYr�zFixtureRequest.cls�s\���:�:�2�2� �#8�����O�!T�U�U��!�!�+�+�G�N�N�,@�,@�A����:�:��rXc�P�|jdk7ryt|jdd�S)z<Instance (can be None) on which test function was collected.r�N�instance)rs�getattrr�r�s rYr�zFixtureRequest.instance�s(���:�:��#���t�'�'��T�:�:rXc���|jdvrtd|j�d���|jjtj
j�}|�J�|jS)z;Python module object where the test function was collected.)r�r��modulezmodule not available in r�)rsr�r�rmrtrprqry)r��mods  rYrzFixtureRequest.module�s]���:�:�<�<� �#;�D�J�J�<��!W�X�X����(�(����)>�)>�?�������w�w�rXc�|�|jdvrtd|j�d���|jjS)z+Path where the test function was collected.)r�r�r�packagezpath not available in r�)rsr�r�r�r�s rYr�zFixtureRequest.path�s<���:�:�G�G� �#9�$�*�*��_�!U�V�V����$�$�$rXc�2�|j}|jS)z4Keywords/markers dictionary for the underlying node.)rg�keywords)r�rgs  rYrzFixtureRequest.keywords�s�� �9�9���}�}�rXc�.�|jjS)zPytest session object.)r�rZr�s rYrZzFixtureRequest.session�s�����'�'�'rXc��t��)z�Add finalizer/teardown function to be called without arguments after
        the last test within the requesting test context finished execution.r��r��	finalizers  rY�addfinalizerzFixtureRequest.addfinalizer�r�rXc�:�|jj|�y)a
Apply a marker to a single test function invocation.

        This method is useful if you don't want to have a keyword/marker
        on all function invocations.

        :param marker:
            An object created by a call to ``pytest.mark.NAME(...)``.
        N)rg�
add_marker)r��markers  rY�applymarkerzFixtureRequest.applymarker�s��	
�	�	���V�$rXc��td||��)zqRaise a FixtureLookupError exception.

        :param msg:
            An optional custom error message.
        N)�FixtureLookupError)r��msgs  rY�
raiseerrorzFixtureRequest.raiseerror�s��!��t�S�1�1rXc�p�|j|�}|j�Jd|�d���|jdS)a�Dynamically run a named fixture function.

        Declaring fixtures via function argument is recommended where possible.
        But if you can only decide whether to use another fixture at test
        setup time, you may use this function to retrieve it inside a fixture
        or test function body.

        This method can be used during the test setup phase or the test run
        phase, but during the test teardown phase a fixture's value may not
        be available.

        :param argname:
            The fixture name.
        :raises pytest.FixtureLookupError:
            If the given fixture could not be found.
        zThe fixture value for "zQ" is not available.  This can happen when the fixture has already been torn down.r)�_get_active_fixturedefrP)r�r~rhs   rY�getfixturevaluezFixtureRequest.getfixturevalue�sS��,�0�0��9�
��'�'�3�	
�%�g�Y�/K�
K�	
�3��'�'��*�*rXc#�tK�|}t|t�r"|��|j}t|t�r�!yy�w)zjYield all SubRequests in the chain, from self up.

        Note: does *not* yield the TopRequest.
        N)rd�
SubRequest�_parent_request)r��currents  rY�_iter_chainzFixtureRequest._iter_chains3����
����*�-��M��-�-�G���*�-�s�38�8c���|dk(r |dgdf}t|tj�S|jj	|�}|�|j||j�|S|jj	|d�}|�7|jj||j�}|�||j|<|�t||��|st||��d}|j�D]}|j|k(s�|dz}�|t|�kDrt||��||}	|jj}|�<||j"vr.|j"|}|j$|}	|j&|}
n%t(}d}	|j}
|j+|�|j||
�t-||
||	|d��}|j/|��||j|<|S#t $rd}Y��wxYw)N�requestrr��Tr��r)rOrCrHr�r�r�rQr�r^�getfixturedefsr�rrr�r�r�r��paramsr�r�r+�_check_fixturedef_without_paramr�execute)r�r~rPrh�fixturedefsr�rr��paramr�rs�
subrequests            rYrz%FixtureRequest._get_active_fixturedef%s���i��!�A�3��-�M�#�M�5�>�>�B�B��'�'�+�+�G�4�
��!����j�*�*;�*;�<����+�+�/�/���>�����.�.�=�=�g�t�GW�GW�X�K��&�1<��%�%�g�.���$�W�d�3�3��$�W�d�3�3����'�'�)�	�G��"�"�g�-���
��	�
�6�C��$�$�$�W�d�3�3� ��'�
�	��'�'�0�0�H���G�x���$>��O�O�G�,�E�"�*�*�7�3�K��'�'��0�E��E��K��%�%�E��0�0��<����*�e�,���%���Z�4�
�
�
	���:��.�&0����7�#����+�	��H�	�s�G�G,�+G,c
���|j}|jdu}t|dd�}|r@|r>|j�d|j�dt|�j��}t|d��|r�tj�d}tj|d�}t|j�}|j}		t|j|j j"��}
t'|j(|j j"�}d	|j�d
|j*�d|�d|
�d
|	��
}t|d��yy#t$$rt|�}
Y�twxYw)zVCheck that this request is allowed to execute this fixturedef without
        a param.N�
nofuncargsFzG does not support fixtures, maybe unittest.TestCase subclass?
Node id: z
Function type: ��pytracerDrz=The requested fixture has no parameter defined for test:
    z

Requested fixture 'z' defined in:
z

Requested here:
�:)r�r r��namere�typerSr<�inspect�stack�getframeinfor?�filename�linenor}�relative_tor��rootpath�
ValueErrorr)�funcr~)r�rh�funcitem�
has_params�fixtures_not_supportedr�frame�	frameinfo�source_path�
source_lineno�source_path_str�locations            rYr!z.FixtureRequest._check_fixturedef_without_paramnsg���#�#���&�&�d�2�
�!(��<��!G���0��=�=�/�"�$�O�O�,�-"�"&�x�.�"9�"9�!:�<�
�

��e�$���M�M�O�A�&�E��,�,�U�1�X�6�I�&�y�'9�'9�:�K�%�,�,�M�
3�"%�k�&=�&=�h�o�o�>V�>V�&W�"X��#�:�?�?�H�O�O�4L�4L�M�H�����'�(&�&0�&8�&8�%9���*�$�"�#�1�]�O�5�
�
��e�$�%���
3�"%�k�"2��
3�s�=.E	�	E �E c�~�|j�D�cgc]}|j��}}|j�|Scc}wr\)r�_fixturedef�reverse)r�r�valuess   rY�_get_fixturestackz FixtureRequest._get_fixturestack�s9��59�5E�5E�5G�H�'�'�%�%�H��H������
��Is�:N)r�rHr��
str | Noner�r�r�zdict[str, FixtureDef[Any]]r��boolr�r�)r�r]�r�rC�r�rA�r��-FixtureDef[object] | PseudoFixtureDef[object]r�rCr�r�)r�r�)r�r0)r�r)r�zMutableMapping[str, Any])r�r7�r	zCallable[[], object]r�r�)r
zstr | MarkDecoratorr�r�)rrDr�r)r~r}r�r)r�zIterator[SubRequest])r~r}r�rI)rh�FixtureDef[object]r�r�)r�zlist[FixtureDef[Any]])rSrTrUr�r��propertyr^�abc�abstractmethodrQrsr�r�rgr�r�r�r�rr�rrZr
rrrrrr!rCrWrXrYr�r�cs���� ���� ��>�	�
1����
��>�8��8�����$���$��!��!�	���$�K�$��$�
�	$��$���������$���$��'��'��$��$������;��;������%��%�����
�(��(�	���$��$�
	%�2�+�:.�G��G�	6�G�R%�BrXr�c�x��eZdZdZdd�d�fd�Zedd��Z						d
d�Zed��Zdd�Z	dd	�Z
dd
�Z�xZS)�
TopRequestz7The type of the ``request`` fixture in a test function.Fr�c�r��t�|�d||jjj	�i|��y)N)r�r�r�r�r�)�superr��_fixtureinfor��copy)r�r�r��	__class__s   �rYr�zTopRequest.__init__�s9���
����!�&�3�3�D�D�I�I�K���	�	
rXc�"�tjSr\)rCrHr�s rYrQzTopRequest._scope�s���~�~�rXc��yr\rWr�s   rYr�zTopRequest._check_scope�s��	
rXc��|jSr\)r�r�s rYrgzTopRequest.node�s�����rXc�"�d|j�d�S)Nz<FixtureRequest for �>)rgr�s rY�__repr__zTopRequest.__repr__�s��%�d�i�i�]�!�4�4rXc��|j}|jD]/}||jvs�|j|�|j|<�1yr\)r�r��funcargsr)r�r�r~s   rY�
_fillfixtureszTopRequest._fillfixtures�sI�������(�(�	G�G��d�m�m�+�)-�)=�)=�g�)F��
�
�g�&�	GrXc�:�|jj|�yr\)rgr
rs  rYr
zTopRequest.addfinalizer�s���	�	���y�)rX)r�rHr�rEr�r�rFrH�r�r}r�rJ)
rSrTrUr�r�rLrQr�rgr[r^r
�
__classcell__�rUs@rYrPrP�sg���A�BG�
�����
�K�
��
�
�	
�� �� �5�G�*rXrPc���eZdZdZdd�													d�fd�Zdd�Zed
d��Zed��Z						dd�Z	dd	�Z
dd
�Z�xZS)rzjThe type of the ``request`` fixture in a fixture function requested
    (transitively) by a test function.Fr�c����t�|�|j|j|j|j
|��||_||_||_|tur||_
||_y)N)r�r�r�r�r�)rRr�r�r~r�r�r�_scope_fieldr@r+r$r�)r�rrsr$r�rhr�rUs       �rYr�zSubRequest.__init__�so���	����*�*�"�*�*� �.�.�#�4�4��	�	
�7>���#(���6@�������D�J�"-��rXc�<�d|j�d|j�d�S)Nz<SubRequest z for rZ)r�r�r�s rYr[zSubRequest.__repr__�s%���d�.�.�1��t�7G�7G�6J�!�L�LrXc��|jSr\)rer�s rYrQzSubRequest._scope�s��� � � rXc�`�|j}|tjur
|j}nI|tjur!t|j|j�}nt|j|�}|�|tjur|j}|sJd|�d|j����|S)Nz#Could not obtain a node for scope "z" for function )	rQrCrHr�rarjr@ruro)r�rsrgs   rYrgzSubRequest.node�s��������E�N�N�"�&*�&6�&6�D�
�e�m�m�
#�$�T�%5�%5�t�7G�7G�H�D�!�$�"2�"2�E�:�D��<�E�U�[�[�0��#�#�D��e�:�5�'��QU�Qa�Qa�Pd�e�e�t��rXc�F��t|t�ry�j|kDr�|j}dj	�fd��j�D��}�j
|�}td|j�d|�d�jj�d|�d|��
d�	�yy)
N�
c3�@�K�|]}�j|����y�wr\)�_format_fixturedef_line)r�rhr�s  �rYr�z*SubRequest._check_scope.<locals>.<genexpr>�s$�����&���,�,�Z�8�&�s�z'ScopeMismatch: You tried to access the z scoped fixture z with a z2 scoped request object. Requesting fixture stack:
z
Requested fixture:
Fr()	rdrOrQr~�joinrCrlr<r�)r�r�r�r~�
fixture_stack�requested_fixtures`     rYr�zSubRequest._check_scope�s����
�*�,<�=���;�;��(�*�2�2�G� �I�I�&�"&�"8�"8�":�&��M�!%� <� <�=Q� R���9�/�:O�:O�9P�Q�"�)�8�D�K�K�,=�,=�+>�?.�.;�_�='�'8�&9�;��
�)rXc��|j}t|�\}}t|t�r*t	|j
jj|�}tj|�}|�d|dz�d|j�|��S)Nr*rz:  def )r5rrdrr@r�rZr�r-�	signaturerS)r�rh�factoryr�r1rqs      rYrlz"SubRequest._format_fixturedef_line
sw���/�/��"�7�+���f��d�D�!��t�/�/�7�7�<�<�d�C�D��%�%�g�.�	���q��!���G�G�,<�,<�+=�i�[�I�IrXc�:�|jj|�yr\)r@r
rs  rYr
zSubRequest.addfinalizers�����%�%�i�0rX)rr�rsrCr$rr�rrhrKr�rEr�r�r`rFrH)rhrKr�r}rJ)
rSrTrUr�r�r[rLrQrgr�rlr
rarbs@rYrr�s����*� �.��.��.��	.�
�.�'�
.��.�
�.�0M��!��!��
��
��K����
�	�.J�1rXrc�2�eZdZdZ	d							dd�Zdd�Zy)rz:Could not return a requested fixture (missing or invalid).Nc�X�||_||_|j�|_||_yr\)r~rrC�fixturestackr)r�r~rrs    rYr�zFixtureLookupError.__init__s*��������#�5�5�7�����rXc�z�g}|j}|jjjg}|j	td�|j��|j}|�|dd}|D]�}t|�\}}	tjt|��\}}	|d|�d|dz���t|�D]A\}
}|j�}|d|z�|j�jd�s�A����|��|jj&}
t)�}|jjj*}|�J�|
j,j/�D]4\}}t1|
j3||��}|s�$|j5|��6|j6|vrd	|j6�d
�}nd|j6�d�}|d
j9dj;t=|���z
}|dz
}t?|||j6�S#t t"t$f$rd}||||dzfz�Y���wxYw)Nc��|jSr\)r5)�xs rY�<lambda>z/FixtureLookupError.formatrepr.<locals>.<lambda>&s
��1�6�6�rXr�zfile z, line rz  �defz+file %s, line %s: source code not availablez) recursive dependency involving fixture 'z
' detectedz	fixture 'z' not foundz
 available fixtures: {}z, z6
 use 'pytest --fixtures [testpath]' for help on them.) �appendrr�ryr��maprvrrr-�getsourcelinesr%�	enumerate�rstrip�lstrip�
startswith�OSError�
IndexError�	TypeErrorr^r�rir�r�r��_matchfactoriesr�r~�formatrmr��FixtureLookupErrorRepr)r��tblines�addliner.rr��fspathr1�linesr�r��line�	error_msg�fm�	availablerir+r#�faclists                   rY�
formatreprzFixtureLookupError.formatrepr"s0�����.�.�����)�)�-�-�.��
���S�)�4�+<�+<�=�>��h�h���?��#�2�J�E��
	�H�(��2�N�F�F�
�"�1�1�-��2I�J���q�
�%��x�w�v��z�l�;�<�(��/��G�A�t��;�;�=�D��D�4�K�(��{�{�}�/�/��6��	�
	��;����-�-�B���I��\�\�-�-�4�4�F��%�%�%�%'�%8�%8�%>�%>�%@�
(�!��k��r�1�1�+�v�F�G����M�M�$�'�
(��|�|�y�(�?����~�Z�X��"�$�,�,��{�;���.�5�5�d�i�i��y�@Q�6R�S�S�C��L�L�C�%�f�f�g�s�D�L�L�Q�Q��;�Z��3�
:�I�	��	�V�V�a�Z�$8�8�9�
:�s�=!H�&H:�9H:r\)r~rDrr�rrDr�r�)r�r�)rSrTrUr�r�r�rWrXrYrrs7��D�OS��!��,:��AK��	
��+RrXrc�4�eZdZ												dd�Zdd�Zy)r�c�J�||_||_||_||_||_yr\)r��errorstringr0�firstlinenor~)r�r0r�r�r�r~s      rYr�zFixtureLookupErrorRepr.__init__Qs)�����&��� ��
�&�����rXc�(�|jD]!}|j|j���#|jj	d�}|ru|jt
j�d|dj���d��|ddD]6}|jt
j�d|j���d���8|j�|jdtj|j�|jdzfz�y)Nrjz       rT��redrz%s:%d)
r�r�r�r��splitr �fail_marker�strip�flow_marker�osr�r0r�)r��tw�tbliner�r�s     rY�
toterminalz!FixtureLookupErrorRepr.toterminal_s����l�l�	%�F��G�G�F�M�M�O�$�	%�� � �&�&�t�,����G�G�#�/�/�0���a����8H�7I�J��
�
��a�b�	�
�����'�3�3�4�G�D�J�J�L�>�J����
�
	���	�
����2�9�9�T�]�]�3�T�5E�5E��5I�J�J�KrXN)r0zstr | os.PathLike[str]r�rr��
Sequence[str]r�r}r~rDr�r�)r�r"r�r�)rSrTrUr�r�rWrXrYr�r�PsG���(�����	�
���
�
��LrXr�c�t�t|�rettdttddff|�}|di|��}	t|�}tjt||�}|j|�|Sttdtf|�}|di|��}|S#t$rt|j�d��d�wxYw)N.z did not yield a valuerW)
r*r
r	rrJ�next�
StopIterationr4r��	functools�partial�_teardown_yield_fixturer
)�fixturefuncr�kwargs�	generator�fixture_resultr	s      rY�call_fixture_funcr�rs����K� ���S�)�L�$��$<�=�=�>��
�� �)�&�)�	�	W�!�)�_�N��%�%�&=�{�I�V�	����Y�'����8�C��$5�6��D��$�.�v�.������	W��� 3� 3�4�4J�K�L�RV�V�	W�s�B�#B7c	��	t|�t|�\}}tdt|�j	��d|�d|dz��d��y#t
$rYywxYw)z�Execute the teardown of a fixture function by advancing the iterator
    after the yield and ensure the iteration ends (if not it means there is
    more than one yield in the function).z-fixture function has more than one 'yield':

rjr*rFr(N)r�rr<r�indentr�)r��it�fsr1s    rYr�r��sl��
��R��!��-�
��F��=��k�"�)�)�+�,�B��d�!�F�Q�J�<�
!��		
��	�
��
�s�A�	A�Ac��	|||��}t|t�st	d|�d|�d|��d�	�|S#t$r}td|�d|�d��|�d}~wwxYw)
N)�fixture_namer�zError evaluating z while defining fixture 'zC'.
Expected a function with the signature (*, fixture_name, config)z	Expected z+ to return a 'str' while defining fixture 'z', but it returned:
Fr()�	Exceptionr�rdr}r<)�scope_callabler�r�r��es     rY�_eval_scope_callabler��s���
� �\�&�I���f�c�"����'�'R�S_�R`�`u��j�
��	
�
�M�������/�/H���WO�
O�
��	���s�
4�	A�A�Ac�~�eZdZdZ	ddd�																	d
d�Zedd��Zdd�Zdd�Zdd	�Z	dd
�Z
dd�Zy)�
FixtureDefz�A container for a fixture definition.

    Note: At this time, only explicitly documented fields and methods are
    considered public stable API.
    NFr�c��t|�|xsd|_|du|_||_||_|�t
j}nt|�r
t|||�}t|t�r&tj|d|j�d�|��}||_
||_||_t!||��|_d|_g|_y)N�z	Fixture '�')�descr�where�r+)r4rf�has_locationr5r~rCrH�callabler�rdr}�	from_userrSrQr �idsr'r�rP�_finalizers)	r�r�rfr~r5rsr r�r�s	         rYr�zFixtureDef.__init__�s���	�y�!�$�\�r���$*��#5�����	�%����=��N�N�E�
�e�_�(����@�E��e�S�!��O�O��y�����q�9���E�#���#������.�t�'�B��
�IM���>@��rXc�.�|jjSr�r�r�s rYrszFixtureDef.scope�r�rXc�:�|jj|�yr\)r�r|rs  rYr
zFixtureDef.addfinalizer�s�������	�*rXc���g}|jr/|jj�}	|�|jr�/|j}|j
j
||��d|_|jj�t|�dk(r|d�t|�dkDr$d|j�d|��}t||ddd���y#t$r}|j|�Yd}~��d}~wwxYw)N�rhrrrz#errors while tearing down fixture "z" of r�)r�r��
BaseExceptionr|rg�ihook�pytest_fixture_post_finalizerrP�clearr�r~rF)r�r�
exceptions�finr�rgrs       rY�finishzFixtureDef.finish�s���*,�
�����"�"�&�&�(�C�
%�������|�|���
�
�0�0�D�'�0�R�"�������� ��z�?�a���Q�-��
��_�q�
 �7����~�U�4�&�Q�C�$�S�*�T�r�T�*:�;�;�!��!�
%��!�!�!�$�$��
%�s�C�	C2�C-�-C2c�>�g}|jD]5}|j|�}t|t�r�%|j	|��7|j
��|j
|�}|j
d}	t||k(�}|rC|j
d�#|j
d\}}	|j|	��|j
d}
|
S|j|�|j
�J�tj|j|��}|D]}|j|��|jj }
	|
j#||��}
|jj|�|
S#ttf$r||u}Y��wxYw#|jj|�wxYw)z=Return the value of this fixture, executing it if not cached.r�rrr�)r�rrdrOr|rP�	cache_keyrEr4�RuntimeError�with_tracebackr�r�r�r
rgr��pytest_fixture_setup)r�r�*requested_fixtures_that_should_finalize_usr~rh�request_cache_keyr��	cache_hit�exc�exc_tbr�r	�parent_fixturer�s              rYr"zFixtureDef.execute
s���68�2��}�}�	N�G� �7�7��@�J��j�*:�;�:�A�A�*�M�	N����)� $���w� 7���*�*�1�-�I�
;�!�!2�i�!?�@�	�
��%�%�a�(�4�"&�"4�"4�Q�"7�K�C���,�,�V�4�4�!�/�/��2�F�!�M�
�K�K�� ��%�%�-�-�-�
�%�%�d�k�k�7�C�	�H�	3�N��'�'�	�2�	3����"�"��	1��/�/�4��/�Q�F�
�L�L�%�%�i�0��
��A��-�
;�-��:�	�
;��<
�L�L�%�%�i�0�s�4E&�6E?�&E<�;E<�?Fc��t|dd�S)Nr$)r�)r�rs  rYr�zFixtureDef.cache_keyJs���w���.�.rXc�V�d|j�d|j�d|j�d�S)Nz<FixtureDef argname=z scope=z baseid=rZ)r~rsrfr�s rYr[zFixtureDef.__repr__Ms/��%�d�l�l�%5�W�T�Z�Z�N�(�SW�S^�S^�Ra�ab�c�crXr\)r�r0rfrDr~r}r5�_FixtureFunc[FixtureValue]rsz?Scope | _ScopeName | Callable[[str, Config], _ScopeName] | Noner �Sequence[object] | Noner��Atuple[object | None, ...] | Callable[[Any], object | None] | Noner�rEr�r�rGrJ)rrr�r�)rrr�rJ)rrr��objectr`)rSrTrUr�r�rLrsr
r�r"r�r[rWrXrYr�r��s����RV�7A� �7A��7A��7A��	7A�
)�7A�O�
7A�(�7A�O�7A��7A�
�7A�r�!��!�+�<�*;�z/�drXr�c��|j}|j}|�ct|d�r"t||jj
�s|St
|j�}||jk7r|j|�}|S)zKGet the actual callable that can be called to obtain the fixture
    value.�__self__)r5r��hasattrrdr�rUr(�__get__)rhrr�r�s    rY�resolve_fixture_functionr�Qs}��
�/�/�K����H����;�
�+�J��� � �*�*�5
����
���0���*�/�/�)�%�-�-�h�7�K��rXc�P�i}|jD]}|j|�||<�t||�}|j|�}	t	|||�}||df|_|S#t
$r=}t
|tj�rd|_	d|||jff|_�d}~wwxYw)zExecution of fixture setup.TN)r�rr�r�r�r>rdr=r��_use_item_location�
__traceback__rP)rhrr�r~r��my_cache_keyr�r�s        rYr�r�is����F��&�&�;��!�1�1�'�:��w��;�+�:�w�?�K��'�'��0�L�	�"�;���@��!'��d�;�J���M�����a����(�$(�A� �$(�,��A�O�O�8L�#M�
� �
���s�
A�	B%�(8B � B%r�rxc���|jxs|j}d|�d��tj|��fd��}t	|�|_t
t|�S)z�Wrap the given fixture function so we can raise an error about it being called directly,
    instead of used as an argument in a test function.z	Fixture "ad" called directly. Fixtures are not meant to be called directly,
but are created automatically when test functions request them as parameters.
See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and
https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly about how to update your code.c� ��t�d��y)NFr(r;)�argsr��messages  �rYr�z=wrap_function_to_error_out_if_called_directly.<locals>.result�s
����W�e�$rX)r+rSr��wrapsr#�__pytest_wrapped__r
rK)r��fixture_markerr+r�r�s    @rY�-wrap_function_to_error_out_if_called_directlyr��sl������3�(�"3�"3�D�
�D�6�w�	w���_�_�X��%��%�
!/�x� 8�F�����(�(rXc�j�eZdZUded<ded<dZded<dZd	ed
<dZded<dZd
ed<dd�Zdd�Z	y)rx�0_ScopeName | Callable[[str, Config], _ScopeName]rsztuple[object, ...] | Noner FrE�autouseNr�r�rDr+zdataclasses.InitVar[bool]r�c��t|�yr\r3)r�r�s  rY�
__post_init__z#FixtureFunctionMarker.__post_init__�s
���y�!rXc�x�tj|�rtd��t|dd�rtd|j����t|d�rt
jtd��t||�}|jxs|j}|dk(rt|�}td	|��d�
�||_
|S)Nz2class fixtures not supported (maybe in the future)rwFzE@pytest.fixture is being applied more than once to the same function �
pytestmarkr���
stacklevelrz?'request' is a reserved word for fixtures, use another name:
  r()r-�isclassr4r�rSr��warnings�warnr5r�r+r)r<rw)r�r�r+r>s    rY�__call__zFixtureFunctionMarker.__call__�s����?�?�8�$��Q�R�R��8�5�u�=��W�X`�Xi�Xi�Wl�m��
��8�\�*��M�M�.�Q�7�@��4�P���y�y�-�H�-�-���9��"�8�,�H��R�S[�R\�]��
�+/��'��rX)r�rEr�r�)r�rKr�rK)
rSrTrUrVr�r�r+r�r�r�rWrXrYrxrx�sD��<�;�%�%��G�T��MQ�C�	J�Q��D�*��+0�I�(�0�"�rX�rsr r�r�r+c��yr\rW��fixture_functionrsr r�r�r+s      rY�fixturer�s��rXc��yr\rWrs      rYrr�s�� rXFc��t||�t|�nd||�dnt|�r|n
t|�|d��}|r||�S|S)a�Decorator to mark a fixture factory function.

    This decorator can be used, with or without parameters, to define a
    fixture function.

    The name of the fixture function can later be referenced to cause its
    invocation ahead of running tests: test modules or classes can use the
    ``pytest.mark.usefixtures(fixturename)`` marker.

    Test functions can directly use fixture names as input arguments in which
    case the fixture instance returned from the fixture function will be
    injected.

    Fixtures can provide their values to test functions using ``return`` or
    ``yield`` statements. When using ``yield`` the code block after the
    ``yield`` statement is executed as teardown code regardless of the test
    outcome, and must yield exactly once.

    :param scope:
        The scope for which this fixture is shared; one of ``"function"``
        (default), ``"class"``, ``"module"``, ``"package"`` or ``"session"``.

        This parameter may also be a callable which receives ``(fixture_name, config)``
        as parameters, and must return a ``str`` with one of the values mentioned above.

        See :ref:`dynamic scope` in the docs for more information.

    :param params:
        An optional list of parameters which will cause multiple invocations
        of the fixture function and all of the tests using it. The current
        parameter is available in ``request.param``.

    :param autouse:
        If True, the fixture func is activated for all tests that can see it.
        If False (the default), an explicit reference is needed to activate
        the fixture.

    :param ids:
        Sequence of ids each corresponding to the params so that they are
        part of the test id. If no ids are provided they will be generated
        automatically from the params.

    :param name:
        The name of the fixture. This defaults to the name of the decorated
        function. If a fixture is used in the same module in which it is
        defined, the function name of the fixture will be shadowed by the
        function arg that requests the fixture; one way to resolve this is to
        name the decorated function ``fixture_<fixturename>`` and then use
        ``@pytest.fixture(name='<fixturename>')``.
    NT)rsr r�r�r+r�)rx�tupler�)rrsr r�r�r+r�s       rYrr�sU��v+�� &� 2�u�V�}����K�D�H�S�M�S�u�S�z�
��
�N���.�/�/��rXc	�^�tjtd��t|g|��|||||d��S)z�(Return a) decorator to mark a yield-fixture factory function.

    .. deprecated:: 3.0
        Use :py:func:`pytest.fixture` directly instead.
    r�r�r)r�r�r6r)rrsr r�r�r+r�s       rY�
yield_fixturer	&s@��
�M�M�-�A�.����	
������
��rX)rsc��|jS)z�Session-scoped fixture that returns the session's :class:`pytest.Config`
    object.

    Example::

        def test_foo(pytestconfig):
            if pytestconfig.get_verbosity() > 0:
                ...

    �r�rs rY�pytestconfigr@s���>�>�rXc��|jddgd��|jd�}|jdddd	d
d��|jd
ddd
d��y)N�usefixturesr�z5List of default fixtures to be used with this project)r,�default�help�generalz
--fixturesz
--funcargs�
store_true�showfixturesFziShow available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v'))�action�destrrz--fixtures-per-test�show_fixtures_per_testzShow fixtures per test)�addini�getgroup�	addoption)�parser�groups  rY�pytest_addoptionrOsv��
�M�M��
��
D�	��
�O�O�I�&�E�	�O�O����
��?�
��
�O�O���
%��
%��rXc��|jjrt|�y|jjrt|�yyrl)�optionrrrs rY�pytest_cmdline_mainris5��
�}�}�!�!��V���
�}�}�+�+��v�&��rXc��t�}|jd��D]\}|jjdd�r� t	j
|ji|j��\}}|j|��^|S)a
Return all direct parametrization arguments of a node, so we don't
    mistake them for fixtures.

    Check https://github.com/pytest-dev/pytest/issues/5036.

    These things are done later as well when dealing with parametrization
    so this could be improved.
    �parametrizer��indirectF)r��iter_markersr�r�r9�_parse_parametrize_argsr�r�)rg�parametrize_argnamesr
�
p_argnamesr�s     rY�_get_direct_parametrize_argsr'ss|��&)�U���#�#��#�7�4���}�}� � ��U�3�(�@�@����� &�
�
��M�J��
!�'�'�
�3�4� �rXc�L�ttjd�|D���S)zDDe-duplicate the sequence of names while keeping the original order.c3�.K�|]
}|D]}|����y�wr\rW)r��seqr+s   rYr�z$deduplicate_names.<locals>.<genexpr>�s����D���D��t�D�t�D�s�)rr�r�)�seqss rY�deduplicate_namesr,�s������D�t�D�D�E�ErXc��eZdZdZdd�Z								dd�Zdd�Zdd�Zdd�Z								dd�Z	dd�Z
dd	�Zd
dddd
�															dd�Ze
				dd��Ze
						dd��Zef					dd�Z						d d�Z						d!d�Zy)"r]a�pytest fixture definitions and information is stored and managed
    from this class.

    During collection fm.parsefactories() is called multiple times to parse
    fixture function definitions into FixtureDef objects and internal
    data structures.

    During collection of test functions, metafunc-mechanics instantiate
    a FuncFixtureInfo object which is cached per node/func-name.
    This FuncFixtureInfo object is later retrieved by Function nodes
    which themselves offer a fixturenames attribute.

    The FuncFixtureInfo object holds information about fixtures and FixtureDefs
    relevant for a particular function. An initial list of fixtures is
    assembled like this:

    - ini-defined usefixtures
    - autouse-marked fixtures along the collection chain up from the function
    - usefixtures markers at module/class/function level
    - test function funcargs

    Subsequently the funcfixtureinfo.fixturenames attribute is computed
    as the closure of the fixtures needed to setup the initial fixtures,
    i.e. fixtures needed by fixture functions themselves are appended
    to the fixturenames list.

    Upon the test-setup phases all fixturenames are instantiated, retrieved
    by a lookup of their FuncFixtureInfo.
    c���||_|j|_i|_t�|_d|jjd�i|_|jjj|d�y)Nr�r�
funcmanage)	rZr�r�r��_holderobjseen�getini�_nodeid_autousenames�
pluginmanager�register)r�rZs  rYr�zFixtureManager.__init__�sg�����%�n�n���
JL���25�%���
����"�"�=�1�B
��!�	���$�$�-�-�d�L�ArXc��|�&t|dd�st||j|��}nd}|j|�}|j	|�}t|||�}t
|�}|j|||��\}	}
t|||	|
�S)a�Calculate the :class:`FuncFixtureInfo` for an item.

        If ``func`` is None, or if the item sets an attribute
        ``nofuncargs = True``, then ``func`` is not examined at all.

        :param node:
            The item requesting the fixtures.
        :param func:
            The item's function.
        :param cls:
            If the function is a method, the method's class.
        r'F)r+r�rW)�
parentnoder��ignore_args)	r�r'r+�_getusefixturesnames�_getautousenamesr,r'�getfixtureclosurer�)r�rgr5r�r��usefixturesnames�autousenamesr��direct_parametrize_argsr�r�s           rY�getfixtureinfozFixtureManager.getfixtureinfo�s���$��G�D�,��$F�&�t�$�)�)��E�H��H��4�4�T�:���,�,�T�2��(��7G��R��">�t�"D��)-�)?�)?��%�/�*@�*
�&�
���x��}�o�V�VrXc��|r�|jd�r�t|�}	t|jj	|j
j��}|dk(rd}tjtjk7r1|jtjtj�}nd}|j||�y#t$rd}Y�ywxYw)Nzconftest.pyr��.)�endswithr?r}rir2r�r3r4r��sepr�SEP�replace�parsefactories)r��plugin�plugin_name�conftestpathres     rY�pytest_plugin_registeredz'FixtureManager.pytest_plugin_registered�s���
�;�/�/�
�>�
(��4�L�
��\�0�0�<�<�T�[�[�=Q�=Q�R�S����}����v�v����"��������	�	�:���F����F�F�+���
���
�s�8C�C�Cc#�K�|j�D]4}|jj|j�}|s�+|Ed{����6y7��w)z8Return the names of autouse fixtures applicable to node.N)�	listchainr2r�re)r�rgr6�	basenamess    rYr9zFixtureManager._getautousenames�sI�����.�.�*�	%�J��1�1�5�5�j�6G�6G�H�I��$�$�$�	%�%�s�;A
�A
�A�A
c#�fK�|jd��D]}|jEd{����y7��w)z<Return the names of usefixtures fixtures applicable to node.rr�N)r#r�)r�rg�marks   rYr8z#FixtureManager._getusefixturesnames�s3�����%�%�=�%�9�	!�D��y�y� � �	!� �s�%1�/�1c�V�
�t|�}i�
d}|t|�k7rot|�}|D]P}||vr�|�
vr�
|j||�}|s�"|�
|<|djD]}||vs�|j	|���R|t|�k7r�od�
fd�}	|j|	d��|�
fS)Nr�c�l��	�|}|djS#t$rtjcYSwxYw)Nr�)rQ�KeyErrorrCrH)�arg_namer#r�s  �rY�
sort_by_scopez7FixtureManager.getfixtureclosure.<locals>.sort_by_scope!s?���
.�-�h�7��#�2��-�-�-���
&��~�~�%�
&�s��3�3T)r�rA)rRr}r�rC)r�r�rr�r|�sort)r�r6r�r7�fixturenames_closure�lastlenr~r#�argrSr�s          @rYr:z FixtureManager.getfixtureclosures���� $�L�1��@B������1�2�2��.�/�G�/�

=���k�)���o�-��"�1�1�'�:�F���/:�O�G�,�*�2��7�7�=���&:�:�0�7�7��<�=�

=���1�2�2�	.�	�!�!�m�T�!�B�#�_�4�4rXc	����dd��|jD]��|jj��}|s�!t��fd�|jjd�D��r�Pt
|�D]T}|j�6|j�|jd|j|j�����|jvs�T����y)zLGenerate new tests based on parametrized fixtures used by the given metafuncc�^�tj|ji|j��\}}|Sr\)r9r$r�r�)rNr�r�s   rY�get_parametrize_mark_argnameszKFixtureManager.pytest_generate_tests.<locals>.get_parametrize_mark_argnames/s(��"�:�:�D�I�I�U����U�G�D�!��KrXc3�2�K�|]}��|�v���y�wr\rW)r�rNr~rZs  ��rYr�z7FixtureManager.pytest_generate_tests.<locals>.<genexpr>=s$��������8��>�>��s�r!NT)r"rsr�)rNr8r�r�)r�r�r��any�
definitionr#r�r r!rsr�r�)r��metafuncr�rhr~rZs    @@rY�pytest_generate_testsz$FixtureManager.pytest_generate_tests,s����	� �,�,�"	�G�#�4�4�8�8��A�L�����$�/�/�<�<�]�K����'�|�4�
�
��$�$�0��(�(��"�)�)�!%�(�.�.�&�N�N�)����*�"5�"5�5��
�)"	rXc� �t|�|ddyr\)r�)r�r�s  rY�pytest_collection_modifyitemsz,FixtureManager.pytest_collection_modifyitemsYs�� ��'��a�rXr�NF)rsr r�r�c
��t|j||||||d��}|jj|g�}	|jr|	j|�n8t
|	D�
cgc]}
|
jr�|
��c}
�}|	j||�|r0|jj|xsdg�j|�yycc}
w)a�Register a fixture

        :param name:
            The fixture's name.
        :param func:
            The fixture's implementation function.
        :param nodeid:
            The visibility of the fixture. The fixture will be available to the
            node with this nodeid and its children in the collection tree.
            None means that the fixture is visible to the entire collection tree,
            e.g. a fixture defined for general use in a plugin.
        :param scope:
            The fixture's scope.
        :param params:
            The fixture's parametrization params.
        :param ids:
            The fixture's IDs.
        :param autouse:
            Whether this is an autouse fixture.
        T)r�rfr~r5rsr r�r�r�N)	r�r�r��
setdefaultr�r|r��insertr2)r�r+r5rersr r�r��fixture_defr��fr�s            rY�_register_fixturez FixtureManager._register_fixture]s���>!��;�;��������	
���'�'�2�2�4��<���#�#��N�N�;�'���>�1�q�~�~�Q�>�?�A��N�N�1�k�*���%�%�0�0���2�r�B�I�I�$�O���?s�!C�3Cc��t��r\r�)r��node_or_objs  rYrEzFixtureManager.parsefactories�s
��
"�#�#rXc��t��r\r�)r�rires   rYrEzFixtureManager.parsefactories�r�rXc
���|tur|}n^t|tj�sJ�t	t
|j�}t|jt�sJ�|j}||jvryt|�s&t|tj�st|�}n|}|jj|�t|�D]�}t!||d�}t#|�}t|t$�s�,t'||�}|j(r|j(}t+||�}	|j-|||	|j.|j0|j2|j4����y)axCollect fixtures from a collection node or object.

        Found fixtures are parsed into `FixtureDef`s and saved.

        If `node_or_object` is a collection node (with an underlying Python
        object), the node's object is traversed and the node's nodeid is used to
        determine the fixtures' visibility. `nodeid` must not be specified in
        this case.

        If `node_or_object` is an object (e.g. a plugin), the object is
        traversed and the given `nodeid` is used to determine the fixtures'
        visibility. `nodeid` must be specified in this case; None and "" mean
        total visibility.
        N)r+rer5rsr r�r�)r+rdr�Noder
r�ryrer}r0r.�types�
ModuleTyper,r��dirr-rzrxr�r+r&rgrsr r�r�)
r�rire�	holderobj�holderobj_tpr+�obj_ubr
ryr5s
          rYrEzFixtureManager.parsefactories�sC��&���#�I��k�5�:�:�6�6�6��V�[�_�_�5�I��k�0�0�#�6�6�6� �'�'�F���+�+�+���I�&�z�)�U�EU�EU�/V�#'�	�?�L�$�L������	�*��	�N�	�D�"�,��d�;�F�%�f�-�F��f�&;�<���)�T�*�C��{�{��{�{��#�3�	�2�D��"�"�����l�l��}�}��J�J����
#�
�-	rXc�v�	|j|}t|j||��S#t$rYywxYw)a�Get FixtureDefs for a fixture name which are applicable
        to a given node.

        Returns None if there are no fixtures at all defined with the given
        name. (This is different from the case in which there are fixtures
        with the given name, but none applicable to the node. In this case,
        an empty result is returned).

        :param argname: Name of the fixture to search for.
        :param node: The requesting Node.
        N)r�rQrr�)r�r~rgr#s    rYrzFixtureManager.getfixturedefs�sE��	��/�/��8�K��T�)�)�+�t�<�=�=���	��	�s�,�	8�8c#�K�|j�D�chc]}|j��}}|D]}|j|vs�|���ycc}w�wr\)rcrerf)r�r#rg�n�
parentnodeidsrhs      rYr�zFixtureManager._matchfactories�sQ����,0�+<�+<�+>�?�a����?�
�?�%�	!�J�� � �M�1� � �	!��@�s�A
�A�A
�A
�rZr7r�r�)rg�
nodes.Itemr5zCallable[..., object] | Noner�r�r�r�)rFr/rGr}r�r�)rg�
nodes.Noder��
Iterator[str])rgrxr�rz)r6ryr�r�r7zAbstractSet[str]r�z6tuple[list[str], dict[str, Sequence[FixtureDef[Any]]]])r^rIr�r�)r��list[nodes.Item]r�r�)r+r}r5z_FixtureFunc[object]rerDrsz8Scope | _ScopeName | Callable[[str, Config], _ScopeName]r r�r�r�r�rEr�r�)riryr�r�)rir�rerDr�r�)riznodes.Node | objectrezstr | NotSetType | Noner�r�)r~r}rgryr�z Sequence[FixtureDef[Any]] | None)r#zIterable[FixtureDef[Any]]rgryr�zIterator[FixtureDef[Any]])rSrTrUr�r�r>rIr9r8r:r_rargrrEr+rr�rWrXrYr]r]�s����<
B�"W��"W�+�"W��	"W�

�"W�H,�0%�!�
(5��(5�&�(5�&�	(5�

@�(5�T)�Z(�KU�*.�QU��5P��5P�#�	5P�
�5P�H�
5P�(�5P�O�5P��5P�
�5P�n�$��$�
�$��$��$��$��$�
�	$��$�+1�B�(�B�(�B�
�	B�H>��>�",�>�	)�>�(!�4�!�<F�!�	"�!rXr]c�(�ddlm}||t�S�Nr)�wrap_session)�_pytest.mainr~�_show_fixtures_per_test�r�r~s  rYrrs��)��� 7�8�8rXc��tt||��}tdd�}	t||jt�z�S#t
$rt
||�cYSwxYw)Nz...rt)rr)r}r2�_PYTEST_DIRr4r@)�invocation_dirr5�loc�prefixs    rY�_pretty_fixture_pathr�
sY��
�{�4��0�
1�C�
�%��
#�F�0��6�C�O�O�K�8�8�9�9���0��>�3�/�/�0�s� A�A�Ac������	�ddl}|j�|jj�|jj|��|j
��d�fd��d���fd��	d���	fd�}|jD]
}||��y)Nrc�F��t|��}t�t|��Sr\)r)r@r)r5r�r�s  �rY�get_best_relpathz1_show_fixtures_per_test.<locals>.get_best_relpaths ����$��/���>�4��9�5�5rXc���|j}�dkr|jd�ryt�|j�}�j	|�d���j	d|��d���j	d�tj|j�}|r-t��dkr|jdd	�
�d�y|�y�jdd��y)
Nrr�T��green� -- ��yellowrj�

r��maxsplit�    no docstring availabler�)
r~r�r�r5�writer-�getdoc�write_docstringr�r�)rer~�
prettypath�fixture_docr�r��verboses    ���rY�
write_fixturez._show_fixtures_per_test.<locals>.write_fixture"s�����%�%���a�<�G�.�.�s�3��)�.�+�:J�:J�K�
�
���G�9�T��*�
���4�
�|�$�T��2�
������n�n�[�%5�%5�6������a�<��!�!�&�1�!�5�a�8�
�!�	
�
�G�G�0�d�G�;rXc�b��t|dd�}|�|jsy�j��jdd|j����jdd�|j
��d��t
|jj��D]\}}|�J�|s�
�|d��y)NrS�-zfixtures used by �(�)r�)r�r�r�rBr+r�r�r�)r��infor�r#r�r�r�s    ���rY�
write_itemz+_show_fixtures_per_test.<locals>.write_item5s����'.�t�^�T�'J���<�t�4�4��
���	�
���s�'��	�	�{�3�4�
���s�a�(����7�8��:�;�$�T�%:�%:�%@�%@�%B�C�	+�N�A�{��*�*�*����+�b�/�*�	+rXr`)rerKr�r�)r�rxr�r�)�_pytest.config�perform_collect�invocation_paramsror��create_terminal_writer�
get_verbosityr�)
r�rZrtr��session_itemr�r�r�r�r�s
     @@@@@rYr�r�sq���������-�-�1�1�N�	���	.�	.�v�	6�B��"�"�$�G�6�<�&+�$ �
�
�!���<� �!rXc�(�ddlm}||t�Sr})rr~�_showfixtures_mainr�s  rYrrKs��)��� 2�3�3rXc
��ddl}|j�|jj}|jj|�}|j
�}|j}g}t�}|jj�D]�\}	}
|
�J�|
s�
|
D]�}t|j|�}|j|f|vr�*|j|j|f�|jt!|j"�|jj$t'||j�|j|f�����|j)�d}
|D�]4\}}}}	}|
|k7r8|j+d�s'|j-�|j/dd|���|}
|dkr|	j+d�r�^|j1|	�d��|j2dk7r!|j1d	|j2�d
�d��|j1d|��d�
�|j1d�t5j6|j�}|r(t9||dkr|j;dd��dn|�n|j-dd��|j-���7y)Nrz_pytest.r�zfixtures defined from r�Tr�r�z [z scope])�cyanr�r�rjr�rr�r�r�)r�r�r�ror�r�r�r^r�r�r�r)r5r~r�r|r�rfrTr�rTr�r�rBr�rsr-r�r�r�)r�rZrtr�r�r�r�r��seenr~r#rhr��
currentmodulerfrr��docs                  rYr�r�QsZ��������-�-�1�1�N�	���	.�	.�v�	6�B��"�"�$�G�	�	 �	 �B��I�!$��D� "� 3� 3� 9� 9� ;������&�&�&���%�
	�J��j�o�o�~�>�C��"�"�C�(�D�0���H�H�j�(�(�#�.�/�����
�)�)�*��O�O�.�.�(�����I��&�&���
�
	�	�&�N�N���M�;D��7���
�G�Z��F�"��$�$�Z�0����	����s�4�V�H�=�>� &�
��a�<�G�.�.�s�3��
���G�9�T��*����z�)��H�H�r�*�*�*�+�7�3�$�H�?�
���4�
�|�$�T��2�
������n�n�Z�_�_�-������1��C�I�I�f�q�I�1�!�4�#�
�
�G�G�0�d�G�;�
���	�)rXc�X�|jd�D]}|j||z��y)Nrj)r�r�)r�r�r�r�s    rYr�r��s)���	�	�$����
�����
��rXrw)rgrxrhrKr��nodes.Node | None)rgryrsrCr�r�)ryr�r�zFixtureFunctionMarker | None)r�rxrsrCr�zIterator[FixtureArgKey])r�zSequence[nodes.Item]r�r{)
r��OrderedSet[nodes.Item]r�z>Mapping[Scope, Mapping[nodes.Item, OrderedSet[FixtureArgKey]]]r�zEMapping[Scope, Mapping[FixtureArgKey, OrderedDict[nodes.Item, None]]]rsrCr�r�)r�r�rr�r�rJr�)r�z#Callable[[str, Config], _ScopeName]r�r}r�r0r�rA)rh�FixtureDef[FixtureValue]rr�r�r�)rhr�rrr�rJ)r�rKr�rxr�rK)rrKrsr�r �Iterable[object] | Noner�rEr��?Sequence[object | None] | Callable[[Any], object | None] | Noner+rDr�rK).)rr�rsr�r r�r�rEr�r�r+rDr�rxr\)rzFixtureFunction | Nonersr�r r�r�rEr�r�r+rDr�z'FixtureFunctionMarker | FixtureFunction)rr�r�r0)rr2r�r�)r�r0r�zint | ExitCode | None)rgryr�zset[str])r+z
Iterable[str]r�r�)r�r0r�zint | ExitCode)r�rr�r})r�r0rZr7r�r�)z    )r�r"r�r}r�r}r�r�)��
__future__rrM�collectionsrr�dataclassesr�r-r��pathlibr�sysrm�typingrrr	r
rrr
rrrrrrrrrrrrrrrr�rtr�
_pytest._coderr�_pytest._code.coder r!�_pytest._ior"�_pytest.compatr#r$r%r&r'r(r)r*r+r,r-r.r�r/r0r1�_pytest.config.argparsingr2�_pytest.deprecatedr4r5r6rr7�_pytest.markr8r9�_pytest.mark.structuresr:�_pytest.outcomesr<r=r>�_pytest.pathlibr?r@�
_pytest.scoperArBrC�version_info�exceptiongrouprFrbrGrHrIrJr�rK�_FixtureFuncr��
TracebackType�_FixtureCachedResult�	dataclassrOr_rjrurzr|r��
OrderedSetr�r�r�r��ABCr�rPr�LookupErrorrr�r�r�r�r�r�r�r�rxrr	rrrr'r,r]r�__file__rir�r�r�rr�r�rWrXrY�<module>r�s��"�
�#�����	��
��������������!������� ������%� �/�+�&�)�'�(�*�*�$�&�'�!�%�'�'�(�!�#�,�-�-�,� ��%�1�!�!�)�(�'�$�%�����g��1��(�'�'��~�&���+�8�C��K�3H�I����S�,�
���#�y��t�T�9Q�/R�*R�!S�S����	����	��
���
�m�X�e�&9�&9�:�:�;�		=��
���$����d�#��w�|�,��$��
6�	�
�	�"�	��	��&�����d�#���$��
�T�]��
�"�d�(�^�
�N�
�N�"�N��N�B�.6�!�6�S�6��6��
6��6�r����d�#�7N�7N�$�7N�to�S�W�W�o�d	�&*��&*��&*�R�S1��S1��S1�l�6R��6R��6R�rL�\�L�D�+��6D����(
�$�7����
���	�.�^d���&�^d��^d�B�(��3A����0�(��3=����0)��)�)�)��)�2�����d�#�$�$�$��$�N
�?B�&)��KN���%��<��
$�	�
��
I�
�����
��
� � �?B�&)��KN�� �� �<� �
$�	 �
� �
I�
 �� �� �
� �04�H�?I�&*��KO��H�,�H�<�H�
$�	H�
�H�
I�
H��H�-�H�X������	
��4	�y������4� �&F�u!�u!�p9��7�#�#�$�+�+��0�2!�j4�6�rrX

Youez - 2016 - github.com/yon3zu
LinuXploit