
    [jj                      d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dlm
Z
 d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlZd dlZd dlZd dlZd dlmZ d dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z  d dlm!Z! d dlm"Z" d dlm#Z# d dl$Z$d dl%Z%d dl%m&Z& d dl'm(Z( d dl'm)Z) d dl*m+Z+ d dl*m,Z, d dl-m.Z. d dl/m0Z0 d d l/m1Z1 d d!l/m2Z2 d d"l/m3Z3 d d#l/m4Z4 d d$l/m5Z5 d d%l/m6Z6 d d&l/m7Z7 d d'l/m8Z8 d d(l/m9Z9 d d)l/m:Z: d d*l;m<Z< d d+l;m=Z= d d,l;m>Z> d d-l;m?Z? d d.l@mAZA d d/lBmCZC d d0lBmDZD d d1lBmEZE d d2lBmFZF d d3lBmGZG d d4lBmHZH d d5lBmIZI d d6lBmJZJ d d7lKmLZL d d8lMmNZN d d9lMmOZO d d:lPmQZQ d d;lRmSZS d d<lRmTZT d d=lRmUZU d d>lVmWZW d d?lVmXZX d d@lYmZZZ d dAlYm[Z[ d dBlYm\Z\ d dCl]m^Z^ ej_        dDk     rd dEl`maZa e"rd dFlbmcZc d dGlbmdZd d dHlbmeZe d dIlfmgZg  e#dJdKL          ZhedMeif         ZjedMehf         edMe	eh         f         z  Zkeleheidf         eldeielemejn        dz  f         f         z  ZoddRZpddXZqdd]ZrddaZsddeZt eju        dKf           G dg dh                      Zv e#di          Zwexewdf         ZyddlZzddpZ{ddvZ|dd|Z} eju        dKf           G d} d~                      Z~ G d dej                  Ze G d de                      Ze G d de                      Ze G d de                      Z G d de,          ZddZddZddZ G d deeh                   Z G d dee                   ZddZddZe eju        dKf           G d d                                  Z G d d          Ze!dMdMdMdMdMddd            Ze!	 ddMdMdMdMdddd            Z	 dddddddddZ e1dd          	 dddddddd            Z edN          dd            ZddZddZddÄZddńZddȄZ G dɄ dʦ          Zdd̄Z ee%j                  j        ZddτZdd҄ZddӄZddԄZddՄZdd dۄZdddddܜddZdS (      )annotationsN)defaultdict)deque)OrderedDict)Callable)	Generator)Iterable)Iterator)Mapping)MutableMapping)Sequence)Set)Path)Any)cast)Final)final)Generic)Literal)NoReturn)overload)TYPE_CHECKING)TypeVar)nodes)getfslineno)Source)ExceptionInfoFormatter)TerminalRepr)TerminalWriter)assert_never)
deprecated)get_real_func)getfuncargnames)	getimfunc)getlocation)NOTSET)
NotSetType)safe_getattr)safe_isclass)	signature)_PluggyPlugin)Config)ExitCode)hookimpl)Parsercheck_ispytest)CLASS_FIXTURE_INSTANCE_METHOD)FIXTURE_BASEID_DEPRECATED)'FIXTURE_GETFIXTUREVALUE_DURING_TEARDOWN)FIXTURE_NODEID_DEPRECATED)"FIXTUREDEF_HAS_LOCATION_DEPRECATED) PARSEFACTORIES_NODEID_DEPRECATED)YIELD_FIXTURE)Session)Mark)ParameterSet)MarkDecorator)fail)skip)TEST_OUTCOME)absolutepath)bestrelpath)HIGH_SCOPES)Scope)	ScopeName)PytestWarning)      )BaseExceptionGroup)	CallSpec2)Function)Metafunc)CollectReportFixtureValueT)	covariant.sessionr9   returnNonec                .    t          |           | _        d S N)FixtureManager_fixturemanager)rO   s    T/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/_pytest/fixtures.pypytest_sessionstartrW   u   s    ,W55G    node
nodes.Item
fixturedefFixtureDef[object]nodes.Node | Nonec                    ddl m} |                                 D ]=}t          ||          r+|j        ||j        k    r|c S )|j        |j        k    r|c S >| j        S )Nr   )Package)_pytest.pythonr_   iter_parents
isinstancerY   nodeidbaseidrO   )rY   r[   r_   parents       rV   get_scope_packagerf   y   s     '&&&&&##%% " "fg&& 	"*Z_,,!MMM - =J$555!MMM<rX   	candidateFixtureDef[Any]otherboolc                8   | j         |j         _| j        |j        k    rdS |j        dk    rdS | j                            |j                  o | j        t          |j                           dv S | j         |j         uo|j         | j                                         v S )zReturn whether the visibility of ``candidate`` is strictly more specific
    than that of ``other``, i.e. ``candidate`` is defined on a strict descendant
    in the collection tree of where ``other`` is defined.NF T)/:)rY   rd   
startswithlenra   )rg   ri   s     rV   is_visibility_more_specificrq      s     ~!3 u|++5<24 **5<88 Y=M>
> 	
 	ej(XUZ9>;V;V;X;X-XrX   
nodes.NodescoperC   c                   ddl }|t          j        u r|                     t          j                  S |t          j        u r|                     |j        j                  S |t          j        u r|                     |j        j                  S |t          j	        u r|                     |j        j	                  S |t          j
        u r|                     |j        j
                  S t          |           dS )zGet the closest parent node (including self) which matches the given
    scope.

    If there is no parent node for the scope (e.g. asking for class scope on a
    Module, or on a Function when not defined in a class), returns None.
    r   N)r`   rC   rJ   	getparentr   ItemClasspythonModuler_   r9   mainr    )rY   rs   _pytests      rV   get_scope_noder|      s      ~~ej)))	%+		~~gn2333	%,		~~gn3444	%-		~~gn4555	%-		~~gl2333UrX   objobjectFixtureFunctionMarker | Nonec                >    t          | t                    r| j        S dS )z0Return fixturemarker or None if it doesn't existN)rb   FixtureFunctionDefinition_fixture_function_marker)r}   s    rV   getfixturemarkerr      s#    #011 ,++4rX   )frozenc                  <    e Zd ZU dZded<   ded<   ded<   ded	<   d
S )ParamArgKeyzA key for a high-scoped parameter used by an item.

    For use as a hashable key in `reorder_items`. The combination of fields
    is meant to uniquely identify a particular "instance" of a param,
    potentially shared by multiple items in a scope.
    strargnameintparam_indexzPath | Nonescoped_item_pathtype | Noneitem_clsN)__name__
__module____qualname____doc____annotations__ rX   rV   r   r      sM           LLL "!!!rX   r   _VitemIterator[ParamArgKey]c              #    K   |t           j        usJ 	 | j        }n# t          $ r Y dS w xY wd}|t           j        u rd}n]|t           j        u r| j        j        }nB|t           j        u r| j        }n,|t           j	        u r| j        }| j
        }nt          |           |j        D ]5}|j        |         |k    r|j        |         }t          ||||          V  6dS )zCReturn all ParamArgKeys for item matching the specified high scope.N)rC   rJ   callspecAttributeErrorr9   r_   pathre   ry   rw   clsr    indices
_arg2scoper   )r   rs   r   r   r   r   r   s          rV   get_param_argkeysr      s&     &&&&"m    H	%-		9+	%,		9	%+		98U# L Lw'500&w/';0@(KKKKKK	L Ls    
**itemsSequence[nodes.Item]list[nodes.Item]c                l   i }i }t           D ]f}i x}||<   t          t                    x}||<   | D ]A}t                              t          ||                    }|r|||<   |D ]}d ||         |<   Bgt                              |           }	t          t          |	||t          j	                            S rS   )
rB   r   r   dictfromkeysr   listreorder_items_atscoperC   r9   )
r   argkeys_by_itemitems_by_argkeyrs   scoped_argkeys_by_itemscoped_items_by_argkeyr   argkeysargkey	items_sets
             rV   reorder_itemsr      s    NPOUWO @ @:<<!7:Ek:R:RR!7 	@ 	@Dmm$5dE$B$BCCG @/6&t,% @ @F;?*62488	@ e$$I	
 	
  rX   OrderedSet[nodes.Item]r   <Mapping[Scope, Mapping[nodes.Item, OrderedSet[ParamArgKey]]]r   CMapping[Scope, Mapping[ParamArgKey, OrderedDict[nodes.Item, None]]]c                2    |t           j        u st                     dk     r S ||         }||         }t                      t	                     }i }|ri }d }	|rc|                                }
|
|v s|
|v r t                              fd|                    |
d          D                       }|sd ||
<   n |	                                \  }	} fd||	         D             }t          |          D ]}|                    |           t          D ]}||         }||                             |d          D ]~}||         }t          t          d          sd ||<   |                    |d           <|                                }|                                 d ||<   |                    |           n|c|r9t'          ||||                                          }|                    |           |	                    |	           ||S )NrF   c              3  $   K   | ]
}|v|V  d S rS   r   ).0kignores     rV   	<genexpr>z(reorder_items_atscope.<locals>.<genexpr>,  s0       $ $1F??????$ $rX   r   c                    g | ]}|v |	S r   r   )r   ir   s     rV   
<listcomp>z)reorder_items_atscope.<locals>.<listcomp>5  s%     " " "eArX   pypy_version_infoF)last)rC   rJ   rp   setr   popleftr   r   getpopitemreversed
appendleftrB   hasattrsysmove_to_endcopyclearupdater   
next_loweradd)r   r   r   rs   r   r   items_deque
items_doneno_argkey_itemsslicing_argkeyr   r   _matching_itemsr   other_scopeother_scoped_items_by_argkeyr   argkey_dictbkpreordered_no_argkey_itemsr   s   `                    @rV   r   r     s    #e**q..,U3,U3"uuF,,K)+J
 ,'24 "	&&((Dz!!T_%<%<mm $ $ $ $155dB??$ $ $  G  (,%%$+OO$5$5!" " " "5nE" " " ".11 8 8A**1---'2 8 87F{7S4&5k&B&F&Fq"&M&M 8 8F*Fv*NK#*30C#D#D 
815A + 7 7 7 F F F F
 '2&6&6&8&8 + 1 1 3 3 315A + 2 23 7 7 7 788 E  "	F  	9(=/5CSCSCUCU) )% 7888%JJ~&&&Y  ,'Z rX   initialnamesIterable[str]getfixturedefs1Callable[[str], Sequence[FixtureDef[Any]] | None]Iterator[str]c             #  P   K   i dfd| D ]} |          E d{V  dS )zStatically traverse the fixture dependency closure in DFS order starting
    from initialnames, yielding all requested fixture names (argnames).

    Each argname is only yielded once.
    r   r   rP   r   c              3  2  K                        |           }|dk    rd S |	| V  d| <    |           }|sd S                      | d          }| t          |          k    rd S ||         }|dz
  | <   |j        D ]} |          E d {V  || <   d S )N   )r   rp   argnames)r   indexfixturedefsr[   depcurrent_indicesr   process_argnames        rV   r   z1traverse_fixture_closure.<locals>.process_argnamef  s      ##G,, B;;F =MMM')OG$$nW-- 	F##GR006C$$$$F '
#(19 & 	, 	,C&s++++++++++#(   rX   N)r   r   rP   r   r   )r   r   r   r   r   s    ` @@rV   traverse_fixture_closurer   U  sx       ')O) ) ) ) ) ) ) )6   , ,"?7++++++++++, ,rX   c                  H    e Zd ZU dZdZded<   ded<   ded<   ded	<   ddZdS )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.
    )r   r   name2fixturedefsnames_closuretuple[str, ...]r   r   	list[str]r   z$dict[str, Sequence[FixtureDef[Any]]]r   rP   rQ   c                    t          t          | j        | j        j                            fd| j        D             | j        dd<   dS )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.
        r   c              3  $   K   | ]
}|v |V  d S rS   r   )r   nameclosures     rV   r   z8FuncFixtureInfo.prune_dependency_tree.<locals>.<genexpr>  s(       X X$PW X XrX   N)r   r   r   r   r   r   )selfr   s    @rV   prune_dependency_treez%FuncFixtureInfo.prune_dependency_tree  sf     $!#48  
 
 !Y X X X$2D X X X111rX   NrP   rQ   )r   r   r   r   	__slots__r   r   r   rX   rV   r   r     sz         
 
 RI  "!!! 
 ;:::Y Y Y Y Y YrX   r   c                     e Zd ZdZddd@dZedAd            Zeej        dBd                        Z	edCd            Z
ej        dDd            ZedEd            Zeej        d                         ZedFd            Zed              Zed!             Zed"             Zed#             ZedGd%            ZedHd'            ZedId)            Zej        dJd,            ZdKd/ZdLd2ZdMd5ZdNd7ZdOd9ZdPd:ZdQd<ZdRd>Zd?S )SFixtureRequestzThe 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	_ispytest
pyfuncitemrJ   fixturename
str | Nonearg2fixturedefs'Mapping[str, Sequence[FixtureDef[Any]]]fixture_defsdict[str, FixtureDef[Any]]r   rj   rP   rQ   c               `    t          |           || _        || _        || _        || _        |  d S rS   )r1   r   _pyfuncitem_arg2fixturedefs_fixture_defs)r   r   r   r   r   r   s         rV   __init__zFixtureRequest.__init__  sA     	y!!!"-", (7 %1 	rX   rT   c                $    | j         j        j        S rS   )r  rO   rU   r   s    rV   rU   zFixtureRequest._fixturemanager  s    '77rX   rC   c                    t                      rS   NotImplementedErrorr  s    rV   _scopezFixtureRequest._scope  s     "###rX   rD   c                    | j         j        S zIScope string, one of "function", "class", "module", "package", "session".r
  valuer  s    rV   rs   zFixtureRequest.scope       {  rX   requested_fixturedefr\   requested_scopec                    t                      rS   r  r   r  r  s      rV   _check_scopezFixtureRequest._check_scope  s     "###rX   r   c                    t          | j        j                  }|                    t	          | j                                      |                     |S )z-Names of all active fixtures in this request.)r   r  fixturenamesextendr   r  
difference)r   results     rV   r  zFixtureRequest.fixturenames  sG     d&344c$,--88@@AAArX   c                    t                      )z>Underlying collection node (depends on current request scope).r  r  s    rV   rY   zFixtureRequest.node       "###rX   r,   c                    | j         j        S )z6The pytest config object associated with this request.)r  configr  s    rV   r  zFixtureRequest.config   s     &&rX   c                `    | j         dk    rt          d| j          d          | j        j        S )z=Test function object if the request has a per-function scope.functionzfunction not available in -scoped context)rs   r   r  r}   r  s    rV   r  zFixtureRequest.function  sA     :## HTZHHH   ##rX   c                    | j         dvrt          d| j          d          | j                            t          j        j                  }|r|j        S dS )z:Class (can be None) where the test function was collected.)classr  zcls not available in r   N)rs   r   r  ru   r{   rx   rw   r}   )r   clscols     rV   r   zFixtureRequest.cls  sc     :222 !T!T!T!TUUU!++GN,@AA 	:	 	rX   c                H    | j         dk    rdS t          | j        dd          S )z<Instance (can be None) on which test function was collected.r  Ninstance)rs   getattrr  r  s    rV   r%  zFixtureRequest.instance  s+     :##4t'T:::rX   c                    | j         dvrt          d| j          d          | j                            t          j        j                  }|J |j        S )z;Python module object where the test function was collected.)r  r"  modulezmodule not available in r   )rs   r   r  ru   r{   rx   ry   r}   )r   mods     rV   r(  zFixtureRequest.module  sY     :<<< !WDJ!W!W!WXXX(()>??wrX   r   c                \    | j         dvrt          d| j          d          | j        j        S )z+Path where the test function was collected.)r  r"  r(  packagezpath not available in r   )rs   r   r  r   r  s    rV   r   zFixtureRequest.path'  s:     :GGG !U$*!U!U!UVVV$$rX   MutableMapping[str, Any]c                    | j         }|j        S )z4Keywords/markers dictionary for the underlying node.)rY   keywords)r   rY   s     rV   r.  zFixtureRequest.keywords.  s      9}rX   r9   c                    | j         j        S )zPytest session object.)r  rO   r  s    rV   rO   zFixtureRequest.session4  s     ''rX   	finalizerCallable[[], object]c                    t                      )zAdd finalizer/teardown function to be called without arguments after
        the last test within the requesting test context finished execution.r  r   r0  s     rV   addfinalizerzFixtureRequest.addfinalizer9  r  rX   markerstr | MarkDecoratorc                :    | j                             |           dS )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)rY   
add_marker)r   r5  s     rV   applymarkerzFixtureRequest.applymarker?  s      		V$$$$$rX   msgr   c                $    t          d| |          )zqRaise a FixtureLookupError exception.

        :param msg:
            An optional custom error message.
        NFixtureLookupError)r   r:  s     rV   
raiseerrorzFixtureRequest.raiseerrorJ  s     !tS111rX   r   r   c                0    d| d}t          || |          )NThe fixture value for "a+  " is not available during teardown because it was not previously requested.
Only fixtures that were already active can be retrieved during teardown.
Request the fixture before teardown begins by declaring it in the fixture signature or by calling request.getfixturevalue() before the fixture yields.r<  )r   r   r:  s      rV   _raise_teardown_lookup_errorz+FixtureRequest._raise_teardown_lookup_errorR  s5    [g [ [ [ 	 !$444rX   r   c                p    |                      |          }|j        J d| d            |j        d         S )aF  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. Avoid using it during the teardown phase.

        .. versionchanged:: 9.1
            Calling ``request.getfixturevalue()`` during teardown to request a
            fixture that was not already requested
            :ref:`is deprecated <dynamic-fixture-request-during-teardown>`.

        :param argname:
            The fixture name.
        :raises pytest.FixtureLookupError:
            If the given fixture could not be found.
        Nr@  zQ" is not available.  This can happen when the fixture has already been torn down.r   )_get_active_fixturedefcached_result)r   r   r[   s      rV   getfixturevaluezFixtureRequest.getfixturevalue\  sX    4 0099
'33Kg K K K 433 '**rX   Iterator[SubRequest]c              #  |   K   | }t          |t                    r"|V  |j        }t          |t                     dS dS )zjYield all SubRequests in the chain, from self up.

        Note: does *not* yield the TopRequest.
        N)rb   
SubRequest_parent_request)r   currents     rV   _iter_chainzFixtureRequest._iter_chain}  sX      
 *-- 	.MMM-G *-- 	. 	. 	. 	. 	.rX   c                   |dk    rt          |           S | j                            |          }||                     ||j                   |S | j                            |d           }| | j                            || j                  }|t          ||           |st          ||           d}| 
                                D ]}|j        |k    r|dz  }| t          |          k    rt          ||           ||         }	 | j        j        }n# t          $ r d }Y nw xY w|1||j        v r(|j        |         }|j        |         }|j        |         }	n%t$          }d}|j        }	|                     |           |                     ||j                   t)          | |	|||d          }
| j        j                            | j                  sVt3          j        t7          j        |          d	           |
j        | j        j        j        vr|                     |           |                    |

           || j        |<   |S )Nrequestr   r   r   Tr   )r   rF   
stacklevelrM  ) RequestFixtureDefr  r   r  r
  r  rU   r   r  r=  rK  r   rp   r   r   paramsr   r   r&   _check_fixturedef_without_paramrH  rO   _setupstateis_node_activerY   warningswarnr4   formatstackrA  execute)r   r   r[   r   r   rM  r   paramr   rs   
subrequests              rV   rC  z%FixtureRequest._get_active_fixturedef  s   i$T*** '++G44
!j**;<<< +//>> .==gtGWXXK$Wd333 	4$Wd333 '')) 	 	G"g--
6C$$$$$Wd333 '
	'0HH 	 	 	HHH	Gx$>$>OG,E"*73K'0EEEK%E00<<< 	*j&7888%Z4
 
 

 |'66tyAA 	; M7>wOOO    dl&>&DDD11'::: 	:...&07#s   D D"!D"r[   c           
        | j         }|j        du}t          |dd          }|r9|r7|j         d|j         dt          |          j         }t          |d           |rt          j	                    d         }t          j
        |d                   }t          |j                  }|j        }		 t          |                    |j        j                            }
n# t$          $ r t          |          }
Y nw xY wt'          |j        |j        j                  }d	|j         d
|j         d| d|
 d|	 
}t          |d           dS dS )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: pytracerF   r   z=The requested fixture has no parameter defined for test:
    z

Requested fixture 'z' defined in:
z

Requested here:
rn   )r  rR  r&  r   rc   typer   r=   inspectrY  getframeinfor@   filenamelinenor   relative_tor  rootpath
ValueErrorr%   funcr   )r   r[   funcitem
has_paramsfixtures_not_supportedr:  frame	frameinfosource_pathsource_linenosource_path_strlocations               rV   rS  z.FixtureRequest._check_fixturedef_without_param  s    #&d2
!(<!G!G 	%0 	%= < <$O< <"&x.."9< < 
 e$$$$ 	%MOOA&E,U1X66I&y'9::K%,M3"%k&=&=ho>V&W&W"X"X 3 3 3"%k"2"23":?HO4LMMH55 5&0&85 5 5 5
 #5 5
 &35 5  e$$$$$$%	% 	%s   .,C C76C7list[FixtureDef[Any]]c                j    d |                                  D             }|                                 |S )Nc                    g | ]	}|j         
S r   )_fixturedef)r   rM  s     rV   r   z4FixtureRequest._get_fixturestack.<locals>.<listcomp>  s    HHH''%HHHrX   )rK  reverse)r   valuess     rV   _get_fixturestackz FixtureRequest._get_fixturestack  s6    HHT5E5E5G5GHHHrX   N)r   rJ   r   r   r   r   r   r   r   rj   rP   rQ   )rP   rT   rP   rC   rP   rD   r  r\   r  rC   rP   rQ   )rP   r   )rP   r,   )rP   r   )rP   r,  )rP   r9   r0  r1  rP   rQ   )r5  r6  rP   rQ   )r:  r   rP   r   )r   r   rP   r   )r   r   rP   r   )rP   rF  )r   r   rP   r\   )r[   r\   rP   rQ   )rP   rs  )r   r   r   r   r  propertyrU   abcabstractmethodr
  rs   r  r  rY   r  r  r   r%  r(  r   r.  rO   r4  r9  r>  rA  rE  rK  rC  rS  ry  r   rX   rV   r   r     s               < 8 8 8 X8 $ $ $  X$ ! ! ! X! 	$ $ $ $    X $ $  X$ ' ' ' X' $ $ X$   X ; ; X;   X % % % X%    X
 ( ( ( X( 	$ $ $ $
	% 	% 	% 	%2 2 2 25 5 5 5+ + + +B. . . .R R R Rh% % % %B     rX   r   c                  x     e Zd ZdZddd fd
Zedd            ZddZed             ZddZ	ddZ
ddZ xZS )
TopRequestz7The type of the ``request`` fixture in a test function.Fr   r   rJ   r   rj   rP   rQ   c               h    t                                          d ||j        j        i |           d S )N)r   r   r   r   r   )superr  _fixtureinfor   )r   r   r   	__class__s      rV   r  zTopRequest.__init__  sC    !&3D 	 	
 	
 	
 	
 	
rX   rC   c                    t           j        S rS   )rC   rJ   r  s    rV   r
  zTopRequest._scope  s
    ~rX   r  r\   r  c                    d S rS   r   r  s      rV   r  zTopRequest._check_scope  s	     	rX   c                    | j         S rS   )r  r  s    rV   rY   zTopRequest.node  s    rX   r   c                    d| j         dS )Nz<FixtureRequest for >)rY   r  s    rV   __repr__zTopRequest.__repr__  s    4di4444rX   c                t    | j         }|j        D ](}||j        vr|                     |          |j        |<   )d S rS   )r  r  funcargsrE  )r   r   r   s      rV   _fillfixtureszTopRequest._fillfixtures"  sR    ( 	G 	GGdm++)-)=)=g)F)Fg&	G 	GrX   r0  r1  c                :    | j                             |           d S rS   )rY   r4  r3  s     rV   r4  zTopRequest.addfinalizer(  s    	y)))))rX   )r   rJ   r   rj   rP   rQ   rz  r|  rP   r   r   r}  )r   r   r   r   r  r~  r
  r  rY   r  r  r4  __classcell__r  s   @rV   r  r    s        AABG 
 
 
 
 
 
 
 
    X        X 5 5 5 5G G G G* * * * * * * *rX   r  c                  x     e Zd ZdZddd fdZddZed d            Zed             Zd!dZ	d"dZ
d#dZ xZS )$rH  zjThe type of the ``request`` fixture in a fixture function requested
    (transitively) by a test function.Fr   rM  r   rs   rC   r[  r   r   r   r[   r\   r   rj   rP   rQ   c                  t                                          |j        |j        |j        |j        |           || _        || _        |t          ur|| _	        || _
        || _        |t          j        u r| j        }n>|t          j        u rt          | j        | j                  }nt!          | j        |          }||t          j        u r| j        }|sJ d| d| j                    || _        d S )N)r   r   r   r   r   z#Could not obtain a node for scope "z" for function )r  r  r  r   r  r  rI  rv  r&   r[  r   _scope_fieldrC   rJ   r_   rf   r|   rw   _node)	r   rM  rs   r[  r   r[   r   rY   r  s	           rV   r  zSubRequest.__init__1  s    	*"* .#4 	 	
 	
 	
 7>6@DJ"-#(EN""&*&6DDem##$T%5t7GHHDD!$"2E::D<EU[00#D 	
 	
\%\\HX\\	
 	
 	
 !


rX   r   c                (    d| j         d| j        dS )Nz<SubRequest z for r  )r   r  r  s    rV   r  zSubRequest.__repr__W  s!    Ld.LLt7GLLLLrX   c                    | j         S rS   )r  r  s    rV   r
  zSubRequest._scopeZ  s      rX   c                    | j         S rS   )r  r  s    rV   rY   zSubRequest.node^  s
    zrX   r  r  c                     j         |k    r|j        }d                     fd                                 D                       }                     |          }t          d|j         d| d j         j         d| d| 
d	           d S d S )
N
c              3  B   K   | ]}                     |          V  d S rS   )_format_fixturedef_line)r   r[   r   s     rV   r   z*SubRequest._check_scope.<locals>.<genexpr>j  sE       & & ,,Z88& & & & & &rX   z'ScopeMismatch: You tried to access the z scoped fixture z with a z2 scoped request object. Requesting fixture stack:
z
Requested fixture:
Fr_  )r
  r   joinry  r  r=   r  )r   r  r  r   fixture_stackrequested_fixtures   `     rV   r  zSubRequest._check_scopeb  s    
 ;((*2G II & & & &"&"8"8":":& & &  M !% < <=Q R R;/:O ; ;"; ;,0K,=; ;.;; ; (9; ;       )(rX   c                    |j         }t          |          \  }}t          |t                    rt	          | j        j        j        |          }t          |          }| d|dz    d|j	         | S )Nrn   r   z:  def )
ri  r   rb   r   rA   r  rO   r   r*   r   )r   r[   factoryr   re  sigs         rV   r  z"SubRequest._format_fixturedef_linew  sz    /"7++fdD!! 	Dt/7<dCCD  CC!CCG,<CcCCCrX   r0  r1  c                :    | j                             |           d S rS   )rv  r4  r3  s     rV   r4  zSubRequest.addfinalizer  s    %%i00000rX   )rM  r   rs   rC   r[  r   r   r   r[   r\   r   rj   rP   rQ   r  rz  r|  )r[   r\   rP   r   r}  )r   r   r   r   r  r  r~  r
  rY   r  r  r4  r  r  s   @rV   rH  rH  ,  s        * *  $! $! $! $! $! $! $! $!LM M M M ! ! ! X!   X   *D D D D1 1 1 1 1 1 1 1rX   rH  c                  &    e Zd ZdZ	 ddd
ZddZdS )r=  z:Could not return a requested fixture (missing or invalid).Nr   r   rM  r   r:  rP   rQ   c                b    || _         || _        |                                | _        || _        d S rS   )r   rM  ry  fixturestackr:  )r   r   rM  r:  s       rV   r  zFixtureLookupError.__init__  s1     #5577rX   FixtureLookupErrorReprc                   g }|j         }| j        j        j        g}|                    t          d | j                             | j        }|t          |          dk    r
|d d         }|D ]}t          |          \  }}	 t          j        t          |                    \  }}	 |d| d|dz               t          |          D ]P\  }
}|                                } |d|z              |                                                    d          r nQ# t"          t$          t&          f$ r d} ||||dz   fz             Y w xY w|| j        j        }t+                      }| j        j        j        }|J |j                                        D ]?\  }}t3          |                    ||                    }|r|                    |           @| j        |v rd	| j         d
}nd| j         d}|d                    d                    t?          |                              z  }|dz  }tA          ||||| j                  S )Nc                    | j         S rS   )ri  )xs    rV   <lambda>z/FixtureLookupError.formatrepr.<locals>.<lambda>  s    16 rX   r   r   zfile z, line z  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.)!appendrM  r  r}   r  mapr  r:  rp   r   rb  getsourcelinesr"   	enumeraterstriplstripro   OSError
IndexError	TypeErrorrU   r   re   r  r   r   _matchfactoriesr   r   rX  r  sortedr  )r   tblinesaddlinerY  r:  r  fspathre  linesr   r   line	error_msgfm	availablere   r   r   faclists                      rV   
formatreprzFixtureLookupError.formatrepr  s   .)-.S))4+<==>>>h?s5zzA~~ #2#JE 	 	H(22NFF"1-2I2IJJq
 ;;;vz;;<<<(//  GAt;;==DGD4K((({{}}//66  Z3 : : :I		VVaZ$8899999: ;-BI\-4F%%%%'%8%>%>%@%@ ( (!kr11+vFFGG (MM$'''|y((XXXX  <$,;;;.55diiy@Q@Q6R6RSSSCLLC%ffgsDLQQQs   $D,E
	E
rS   )r   r   rM  r   r:  r   rP   rQ   )rP   r  )r   r   r   r   r  r  r   rX   rV   r=  r=    sT        DD OS    +R +R +R +R +R +RrX   r=  c                      e Zd ZddZddZdS )r  rd  str | os.PathLike[str]firstlinenor   r  Sequence[str]errorstringr   r   r   rP   rQ   c                L    || _         || _        || _        || _        || _        d S rS   )r  r  rd  r  r   )r   rd  r  r  r  r   s         rV   r  zFixtureLookupErrorRepr.__init__  s-     & &rX   twr   c                @   | j         D ])}|                    |                                           *| j                            d          }|r|                    t
          j         d|d                                          d           |dd          D ]:}|                    t
          j         d|                                 d           ;|                                 |                    t          j
        | j                   d| j        dz               d S )Nr  z       r   Tredr   rn   )r  r  r  r  splitr   fail_markerstripflow_markerosr  rd  r  )r   r  tbliner  r  s        rV   
toterminalz!FixtureLookupErrorRepr.toterminal  s/   l 	% 	%FGGFMMOO$$$$ &&t,, 		GG)5PPeAhnn>N>NPP     abb	  -9PP$**,,PP      				
29T]++DDd.>.BDDEEEEErX   N)rd  r  r  r   r  r  r  r   r   r   rP   rQ   )r  r   rP   rQ   )r   r   r   r  r  r   rX   rV   r  r    sB           F F F F F FrX   r  fixturefunc_FixtureFunc[FixtureValue]rM  c                   t          j        |           rt          t          dt          t
                   f         |           }  | di |}	 t          |          }n&# t          $ r t          |j	         d          d w xY wt          j        t          | |          }|                    |           n*t          t          dt
          f         |           }  | di |}|S )N.z did not yield a valuer   )rb  isgeneratorfunctionr   r   r   rM   nextStopIterationrh  r   	functoolspartial_teardown_yield_fixturer4  )r  rM  kwargs	generatorfixture_resultr0  s         rV   call_fixture_funcr    s     ";// /8C<)@$@A;OOK))&))		W!)__NN 	W 	W 	W 3KKKLLRVV	W%&={IVV	Y''''8C$56DD$..v..s   A #A>c           	         	 t          |           t          |           \  }}t          dt          |                                            d| d|dz    d           dS # t
          $ r Y dS w xY w)zExecute 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':

r  rn   r   Fr_  N)r  r   r=   r   indentr  )r  itfsre  s       rV   r  r    s    
R !--
F!k""))++! !! !QJ! ! 		
 	
 	
 	
 	
 	
	    s   A! !
A/.A/scope_callable"Callable[[str, Config], ScopeName]fixture_namer   r  r,   rD   c                    	  | ||          }n)# t           $ r}t          d|  d| d          |d }~ww xY wt          |t                    st	          d|  d| d|d	           |S )
N)r  r  zError 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  rb   r   r=   )r  r  r  r  es        rV   _eval_scope_callabler    s    
  \&III   O O O O O O
 
 	
 fc"" 
  S_   	
 	
 	
 	

 Ms    
616c                      e Zd ZdZ	 d)edddd*dZed+d            Zed,d            Zd-d Z	d.d#Z
d/d%Zd0d'Zd1d(ZdS )2
FixtureDefzA container for a fixture definition.

    Note: At this time, only explicitly documented fields and methods are
    considered public stable API.
    NF)rY   _autouser   r  r,   rd   str | None | NotSetTyper   r   ri  r  rs   =Scope | ScopeName | Callable[[str, Config], ScopeName] | NonerR  Sequence[object] | NoneidsAtuple[object | None, ...] | Callable[[Any], object | None] | NonerY   nodes.Node | NotSetTyper  rj   r   rP   rQ   c               j   t          |
           |t          u rt          j        t          d           |t          u rd }|t          ur|nd | _        |t          ur|j        n|pd| _        |t          up|d u| _        || _	        || _
        |t          j        }n t          |          rt          |||          }t          |t                     r%t          j        |d|j         d| j                  }|| _        || _        || _        t-          ||          | _        d | _        g | _        |	| _        d S )N   rN  rl   z	Fixture '')descrwherer   )r1   r&   rV  rW  r3   rY   rc   rd   _has_locationri  r   rC   rJ   callabler  rb   r   	from_userr   r
  rR  r  r#   r   rD  _finalizersr  )r   r  rd   r   ri  rs   rR  r  rY   r  r   s              rV   r  zFixtureDef.__init__!  sW    	y!!!6>>M3BBBBVF $(v#5#5444	" -1,>,>T[[V\r %)$6$L&:L	%=NEEe__ 	A(@@EeS!! 	O9999  E ## .t'BBB IM>@ !rX   rD   c                    | j         j        S r  r  r  s    rV   rs   zFixtureDef.scopem  r  rX   c                F    t          j        t          d           | j        S )Nr  rN  )rV  rW  r6   r  r  s    rV   has_locationzFixtureDef.has_locationr  s!    8QGGGG!!rX   r0  r1  c                :    | j                             |           d S rS   )r  r  r3  s     rV   r4  zFixtureDef.addfinalizerw  s    	*****rX   rM  rH  c                   | j         d S g }| j        rX| j                                        }	  |             n,# t          $ r}|                    |           Y d }~nd }~ww xY w| j        X|j        }d | _         | j                                         t          |          dk    r|d         t          |          dk    r&d| j         d| }t          ||d d d                   d S )Nr   r   z#errors while tearing down fixture "z" of r   )
rD  r  popBaseExceptionr  rY   r   rp   r   rH   )r   rM  
exceptionsfinr  rY   r:  s          rV   finishzFixtureDef.finishz  s%   % F*,
 	%"&&((C%  % % %!!!$$$$$$$$%	  	% | "   z??aQ-__q  QQQ4QQC$S*TTrT*:;;; ! s   
8 
A!AA!rM   c                P    g } j         D ],}                    |          }|                    |           - j                                       } j        d         }	 t          ||k              }n# t          t          f$ r ||u }Y nw xY w|r? j        d         % j        d         \  }}	|                    |	           j        d         S  	                                j        J t          j         j	                  }
|D ]}|                    |
            j        rJ                       fd           j        j        }	 |                               }j                            |
           n# j                            |
           w xY w|S )z=Return the value of this fixture, executing it if not cached.Nr   r  r   rP  c                 F     j         j                                       S )Nr[   rM  )rY   ihookpytest_fixture_post_finalizer)rM  r   s   rV   r  z$FixtureDef.execute.<locals>.<lambda>  s'    GL&DD E   rX   r  )r   rC  r  rD  	cache_keyrj   rh  RuntimeErrorwith_tracebackr	  r  r  r4  r  rY   r  pytest_fixture_setup)r   rM  *requested_fixtures_that_should_finalize_usr   r[   request_cache_keyr  	cache_hitexcexc_tbr0  parent_fixturer  r  s   ``            rV   rZ  zFixtureDef.execute  s    682} 	J 	JG 77@@J 7==jIIII ) $w 7 7*1-I; !!2i!?@@		- ; ; ;-:			;  1%a(4"&"4Q"7KC,,V444-a00 KK   %---
 %dk7CCC	H 	3 	3N''	2222 ####    	
 	
 	
 "	1 $)#=#= $> $ $F
 L%%i0000GL%%i0000s   #A7 7BBF F#r~   c                $    t          |dd           S )Nr[  )r&  )r   rM  s     rV   r  zFixtureDef.cache_key  s    w...rX   c                8    d| j         d| j        d| j        dS )Nz<FixtureDef argname=z scope=z baseid=r  )r   rs   rd   r  s    rV   r  zFixtureDef.__repr__  s+    cdlccTZccSWS^ccccrX   rS   )r  r,   rd   r  r   r   ri  r  rs   r  rR  r  r  r  rY   r  r  rj   r   rj   rP   rQ   r{  )rP   rj   r}  )rM  rH  rP   rQ   )rM  rH  rP   rM   )rM  rH  rP   r~   r  )r   r   r   r   r&   r  r~  rs   r  r4  r	  rZ  r  r  r   rX   rV   r  r    s
         RVJ! )/J! J! J! J! J! J!X ! ! ! X! " " " X"+ + + +< < < <2D D D DL/ / / /d d d d d drX   r  c                  ,     e Zd ZdZd
 fdZdd	Z xZS )rQ  zA custom FixtureDef for the special "request" fixture.

    A new one is generated on-demand whenever "request" is requested.
    rM  r   rP   rQ   c           
         t                                          j        t          dfdt          j        d j        d           dgd f| _        d S )NrM  c                      S rS   r   rP  s   rV   r  z,RequestFixtureDef.__init__.<locals>.<lambda>  s     rX   T)r  rd   r   ri  rs   rR  rY   r   r   )r  r  r  r&   rC   rJ   rY   rD  )r   rM  r  s    `rV   r  zRequestFixtureDef.__init__  sb    > . 	 		
 		
 		
 &sD1rX   r0  r1  c                    d S rS   r   r3  s     rV   r4  zRequestFixtureDef.addfinalizer  s    rX   )rM  r   rP   rQ   r}  )r   r   r   r   r  r4  r  r  s   @rV   rQ  rQ    s[         
2 2 2 2 2 2       rX   rQ  FixtureDef[FixtureValue]c                   | j         }|j        }| j        t          j        u rGt          |d          r7|j        }t          |t                    st          j
        t          d           |`t          |d          rt          ||j        j                  s|S t          | j                   }|| j         k    r|                    |          }|S )zKGet the actual callable that can be called to obtain the fixture
    value.__self__r  rN  )ri  r%  r
  rC   rw   r   r!  rb   ra  rV  rW  r2   r  r$   __get__)r[   rM  r  r%  bound_tos        rV   resolve_fixture_functionr$    s    
 /K HEK'';
++ 	K"+H h-- K;JJJJ ;
++ 	J *5
 5
 	 
00*/))%--h77KrX   c                   i }| j         D ]}|                    |          ||<   t          | |          }|                     |          }t	          j        |          st	          j        |          r3| j        rdnd}t          |j	        j
        d|j        | dd           	 t          |||          }nE# t          $ r8}t          |t          j                  rd|_        d|||j        ff| _         d}~ww xY w||df| _        |S )	zExecution of fixture setup.z with autouse=Truerl   z requested an async fixture z, with no plugin or hook that handled it. This is an error, as pytest does not natively support it.
See: https://docs.pytest.org/en/stable/deprecations.html#sync-test-depending-on-async-fixtureFr_  TN)r   rE  r$  r  rb  isasyncgenfunctioniscoroutinefunctionr  r=   rY   r   r   r  r?   rb   r>   r  _use_item_location__traceback__rD  )	r[   rM  r  r   r  my_cache_keyauto_strr  r  s	            rV   r  r    si    F& ; ;!11'::w*:w??K''00L!+.. 	
'2M3 3 	
 ,6+>F''B|  l l@S lW_ l l l 		
 	
 	
 	
	";@@   a(( 	( $(A $(,AO8L#M
  !'d;JMs   &B8 8
C:3C55C:c                  l    e Zd ZU ded<   ded<   dZded<   dZd	ed
<   dZded<   dZded<   ddZddZ	dS )FixtureFunctionMarker.ScopeName | Callable[[str, Config], ScopeName]rs   ztuple[object, ...] | NonerR  Frj   autouseNr  r  r   r   zdataclasses.InitVar[bool]r   rP   rQ   c                $    t          |           d S rS   r0   )r   r   s     rV   __post_init__z#FixtureFunctionMarker.__post_init__H  s    y!!!!!rX   r  FixtureFunctionr   c                t   t          j        |          rt          d          t          |t                    rt          d|j                  t          |d          rt          d           t	          || d          }| j        p|j        }|dk    r#t          |          }t          d| d	
           |S )Nz2class fixtures not supported (maybe in the future)zE@pytest.fixture is being applied more than once to the same function 
pytestmarkzMarks cannot be applied to fixtures.
See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-functionT)r  fixture_function_markerr   rM  z?'request' is a reserved word for fixtures, use another name:
  Fr_  )
rb  isclassrh  rb   r   r   r   r=   r   r%   )r   r  fixture_definitionr   rr  s        rV   __call__zFixtureFunctionMarker.__call__K  s    ?8$$ 	SQRRRh 9:: 	mX`Ximm   8\** 	v  
 7tt
 
 
 y-H-9"8,,H]S[]]   
 "!rX   )r   rj   rP   rQ   )r  r2  rP   r   )
r   r   r   r   r/  r  r   r   r1  r8  r   rX   rV   r-  r-  =  s          :999%%%%GMQCQQQQD+0I0000" " " "" " " " " "rX   r-  c                  >    e Zd ZdddddZddZddZddZddZdS )r   NF)r%  r   r  Callable[..., Any]r5  r-  r%  object | Noner   rj   rP   rQ   c               "   t          |           |j        p|j        | _        | j        | _        || _        |;t	          t
          dt          f         |                    |                    | _        n|| _        t          j
        | |           d S )N.)r1   r   r   r   r   r   r   r"  _fixture_functionr  update_wrapper)r   r  r5  r%  r   s        rV   r  z"FixtureFunctionDefinition.__init__k  s     	y!!!+0EH4E	 	(?%%)c"H$4$4X$>$>& &D"" &.D" x00000rX   r   c                    d| j          dS )Nz<pytest_fixture(z)>r=  r  s    rV   r  z"FixtureFunctionDefinition.__repr__  s    <$"8<<<<rX   c                <    t          | j        | j        |d          S )zDBehave like a method if the function it was applied to was a method.T)r  r5  r%  r   )r   r=  r   )r   r%  owners      rV   r"  z!FixtureFunctionDefinition.__get__  s+    (+$($A	
 
 
 	
rX   argsr   kwdsc                >    d| j          d}t          |d           d S )Nz	Fixture "aE  " 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-directlyFr_  )r   r=   )r   rC  rD  messages       rV   r8  z"FixtureFunctionDefinition.__call__  s>    \	 \ \ \ 	 	We$$$$$$rX   c                    | j         S rS   r@  r  s    rV   _get_wrapped_functionz/FixtureFunctionDefinition._get_wrapped_function  s    %%rX   )
r  r:  r5  r-  r%  r;  r   rj   rP   rQ   r  rS   )rC  r   rD  r   rP   r   )rP   r:  )r   r   r   r  r  r"  r8  rH  r   rX   rV   r   r   j  s         #'1 1 1 1 1 1,= = = =
 
 
 
% % % %& & & & & &rX   r   rs   rR  r/  r  r   fixture_functionCallable[..., object]r.  rR  Iterable[object] | Noner/  r  ?Sequence[object | None] | Callable[[Any], object | None] | Noner   r   c                   d S rS   r   rJ  rs   rR  r/  r  r   s         rV   fixturerP    s	     !$rX   c                   d S rS   r   rO  s         rV   rP  rP    s	      CrX   r  FFixtureFunction | None1FixtureFunctionMarker | FixtureFunctionDefinitionc                   t          ||t          |          nd||dnt          |          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)rs   rR  r/  r  r   r   )r-  tupler  )rJ  rs   rR  r/  r  r   fixture_markers          rV   rP  rP    sx    v + & 2uV}}}KDDHSMM%ISSuSzz  N  0~.///rX   zT@pytest.yield_fixture is deprecated. Use @pytest.fixture instead; they are the same.)categoryc          	     `    t          j        t          d           t          | g|R |||||dS )z(Return a) decorator to mark a yield-fixture factory function.

    .. deprecated:: 3.0
        Use :py:func:`pytest.fixture` directly instead.
    r  rN  rI  )rV  rW  r8   rP  )rJ  rs   rR  r/  r  r   rC  s          rV   yield_fixturerY    sV    $ M-A....	     rX   )rs   c                    | j         S )zSession-scoped fixture that returns the session's :class:`pytest.Config`
    object.

    Example::

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

    r  rP  s    rV   pytestconfigr\    s     >rX   parserr/   c                    |                      ddg d           |                     d          }|                    dddd	d
d           |                    dddd
d           d S )NusefixturesrC  z5List of default fixtures to be used with this project)ra  defaulthelpgeneralz
--fixturesz
--funcargs
store_trueshowfixturesFziShow available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v'))actiondestr`  ra  z--fixtures-per-testshow_fixtures_per_testzShow fixtures per test)addinigetgroup	addoption)r]  groups     rV   pytest_addoptionrl  *  s    
MMD	     OOI&&E	OO?     
OO%%      rX   int | ExitCode | Nonec                z    | j         j        rt          |            dS | j         j        rt          |            dS d S )Nr   )optionrd  rg  r[  s    rV   pytest_cmdline_mainrp  D  sG    }! Vq}+ v&&&q4rX   r   r  indirectbool | Sequence[str]rc   (dict[str, Literal['indirect', 'direct']]c                p   t          |t                    r t                              | |rdnd          }nt          |t                    rBt                              | d          }|D ]#}|| vrt          d| d| dd           d||<   $n)t          d| dt          |          j         d           |S )	a:  Resolve 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
    parametrize() call.

    :param argnames:
        List of argument names passed to ``parametrize()``.
    :param indirect:
        Same as the ``indirect`` parameter of ``parametrize()``.
    :param nodeid:
        Node ID to which the parametrization is applied.
    :returns:
        A dict mapping each arg name to either "indirect" or "direct".
    rq  directzIn z: indirect fixture 'z' doesn't existFr_  z1: expected Sequence or boolean for indirect, got )rb   rj   r   r   r   r=   ra  r   )r   rq  rc   arg_directnessargs        rV   _resolve_args_directnessrx  N  s    ( (D!! 
xx1UXVV	Hh	'	' 
x:: 	- 	-C(""J&JJcJJJ!    #-N3	- 	d&dd4PX>>Kbdd	
 	
 	
 	
 rX   set[str]c                T   t                      }|                     d          D ]}|j                            dd          }t	          j        |j        i |j        \  }}t          ||| j                  }|	                    d |
                                D                        |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  rq  Fc              3  ,   K   | ]\  }}|d k    |V  dS )ru  Nr   )r   r   
directnesss      rV   r   z/_get_direct_parametrize_args.<locals>.<genexpr>  s=       $
 $
#X%% %%%%$
 $
rX   )r   iter_markersr  r   r;   _parse_parametrize_argsrC  rx  rc   r   r   )rY   parametrize_argnamesr5  rq  
p_argnamesr   p_directnesss          rV   _get_direct_parametrize_argsr  u  s     &)UU###77 

 

=$$Z77$<[
"M
 

A 0
HdkRR## $
 $
'3'9'9';';$
 $
 $
 	
 	
 	
 	

  rX   seqsr   c                 d    t          t                              d | D                                 S )zDDe-duplicate the sequence of names while keeping the original order.c              3  $   K   | ]}|D ]}|V  d S rS   r   )r   seqr   s      rV   r   z$deduplicate_names.<locals>.<genexpr>  s/      DDDDtDDDDDDDrX   )rU  r   r   )r  s    rV   deduplicate_namesr    s-     DDtDDDDDEEErX   c                  <   e Zd ZdZdTdZdUdZdVdZ ed          dWd            ZdTdZ	dXdZ
dYdZdZdZd[d&Zd\d)Zd]d,Zed-d.d.d/ed0d^d>Zed_d@            Ze edA          d`dD                        Ze	 	 dadbdH            ZeefeedIdcdLZdddOZdedSZd.S )frT   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:

    - config-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.
    rO   r9   rP   rQ   c                   || _         |j        | _        i | _        |t          | j                            d                    i| _        i | _        i | _        |j        j        	                    | d           | 
                    |           d S )Nr_  
funcmanage)rO   r  r  r   getini_node_autousenames_nodeid_autousenames_pending_conftestspluginmanagerregister#_flush_pending_conftests_to_session)r   rO   s     rV   r  zFixtureManager.__init__  s    %n
 JL T$+,,];;<<G

 BD! >@$--dLAAA
 	0099999rX   rY   rZ   ri  Callable[..., object] | Noner   r   r   c                J   |)t          |dd          st          ||j        |          }nd}|                     |          }|                     |          }t          |||          }t          |          }|                     |||          \  }	}
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.
        Nr^  F)r   r   r   )
parentnoder   ignore_args)	r&  r#   r   _getusefixturesnames_getautousenamesr  r  getfixtureclosurer   )r   rY   ri  r   r   usefixturesnamesautousenamesr   direct_parametrize_argsr   r   s              rV   getfixtureinfozFixtureManager.getfixtureinfo  s    $ GD,$F$F&t$)EEEHHH44T::,,T22(7GRR">t"D"D)-)?)?%/ *@ *
 *
& x}oVVVrX   pluginr+   plugin_namer   c                    |r7|                     d          r"t          |          }|j        }|| j        |<   d S |                     || j                   d S )Nzconftest.pyholderrY   )endswithr@   re   r  parsefactoriesrO   )r   r  r  conftestpathconftest_dirs        rV   pytest_plugin_registeredz'FixtureManager.pytest_plugin_registered  sp    
  	B;//>> 	B
 (44L'.L4:D#L111 vDLAAAAArX   T)wrapper	collectornodes.Collector-Generator[None, CollectReport, CollectReport]c              #     K   d V }t          |t          j                  r9| j                            |j        d           }||                     ||           |S )Nr  )rb   r   	Directoryr  r  r   r  )r   r  r  r  s       rV   pytest_make_collect_reportz)FixtureManager.pytest_make_collect_report  sd       i11 	C,00FFF!##6	#BBBrX   c                B   |j         j        }g }t          | j                                                  D ]B\  }}	 |                    |           # t          $ r |                    ||f           Y ?w xY w|D ]$\  }}| j        |= |                     ||           %dS )zAssign Session scope to initial conftests whose directories won't
        be collected as Directory nodes (e.g. ancestors above rootdir).r  N)	r  rg  r   r  r   rf  rh  r  r  )r   rO   rg  orphanedr  r  s         rV   r  z2FixtureManager._flush_pending_conftests_to_session  s     >*.0$()@)F)F)H)H$I$I 	8 	8 L&8((2222 8 8 8v 6777778$, 	= 	= L&'5vG<<<<	= 	=s   A!A54A5c                8    | j                                          dS )av  Clean up any conftests that were never collected by a Directory.

        After __init__ flushes above-rootdir conftests and collection pops
        under-rootdir ones, remaining entries mean collection was interrupted
        (e.g. UsageError for a bad path). These conftests' fixtures aren't
        needed since their directories' tests weren't collected either.
        N)r  r   r  s    rV   pytest_collection_finishz'FixtureManager.pytest_collection_finish  s     	%%'''''rX   rr   r   c              #     K   |                                 D ]O}| j                            |          }|r|E d{V  | j                            |j                  }|r|E d{V  PdS )z8Return the names of autouse fixtures applicable to node.N)	listchainr  r   r  rc   )r   rY   r  	basenamesnodeid_basenamess        rV   r  zFixtureManager._getautousenames'  s      ..** 	, 	,J/33J??I %$$$$$$$$#8<<Z=NOO ,++++++++	, 	,rX   c              #     K   |                     d          D ]D\  }}|j        s+|                    t          d|j         d                     |j        E d{V  EdS )z<Return the names of usefixtures fixtures applicable to node.r_  r  zusefixtures() in z  without arguments has no effectN)iter_markers_with_noderC  rW  rE   rc   )r   rY   marker_nodemarks       rV   r  z#FixtureManager._getusefixturesnames2  s      !%!<!<-!<!P!P 	! 	!K9   !YDKYYY   
 y        	! 	!rX   r  r   r   r  AbstractSet[str]6tuple[list[str], dict[str, Sequence[FixtureDef[Any]]]]c                v     i d fd}dfd}t          t          ||	          |d
          }|fS )Nr   r   rP    Sequence[FixtureDef[Any]] | Nonec                    | v rd S                      |           }|s                    |           }|sd S || <   |S rS   )r   r   )r   r   r   r  r  r   s     rV   r   z8FixtureManager.getfixtureclosure.<locals>.getfixturedefsL  s`    +%%t)--g66K 7"11':FF"  4+6(rX   arg_namerC   c                h    	 |          }|d         j         S # t          $ r t          j        cY S w xY w)Nr   )r
  KeyErrorrC   rJ   )r  r   r   s     rV   sort_by_scopez7FixtureManager.getfixtureclosure.<locals>.sort_by_scopeY  sL    .-h7 #2--  & & &~%%%&s    11r   T)keyrw  )r   r   rP   r  )r  r   rP   rC   )r  r   )r   r  r   r  r   r  fixturenames_closurer   s   `` `   @rV   r  z FixtureManager.getfixtureclosure=  s     AC	 	 	 	 	 	 	 	 		. 	. 	. 	. 	. 	.  &$-    
  
  
 $_44rX   metafuncrK   c           	     d   dd|j         D ]|j                            d          }t          fd|j                            d          D                       rRt          |          D ]?}|j        +|                    |j        d
|j	        |j
                    n|j        vr n@d	S )zLGenerate new tests based on parametrized fixtures used by the given metafuncr  r:   rP   r  c                B    t          j        | j        i | j        \  }}|S rS   )r;   r  rC  r  )r  rC  r   s      rV   get_parametrize_mark_argnameszKFixtureManager.pytest_generate_tests.<locals>.get_parametrize_mark_argnameso  s$    ":DIUUUGD!KrX   r   c              3  2   K   | ]} |          v V  d S rS   r   )r   r  r   r  s     rV   r   z7FixtureManager.pytest_generate_tests.<locals>.<genexpr>y  sH         88>>>     rX   r{  NT)rq  rs   r  )r  r:   rP   r  )r  r  r   any
definitionr~  r   rR  r{  rs   r  r   )r   r  r   r[   r   r  s       @@rV   pytest_generate_testsz$FixtureManager.pytest_generate_testsl  s   	 	 	 	  , "	 "	G#488"EEL      $/<<]KK       '|44  
$0((")!%(.&N )    E *"555E 6C"	 "	rX   r   r   c                .    t          |          |d d <   d S rS   )r   )r   r   s     rV   pytest_collection_modifyitemsz,FixtureManager.pytest_collection_modifyitems  s     ''aaarX   r  NF)rc   rs   rR  r  r/  rY   r   _FixtureFunc[object]rc   r  rs   6Scope | ScopeName | Callable[[str, Config], ScopeName]rR  r  r  r  r/  rj   r  c                  |t           us	|t           u rt          j        t          d           t	          | j        ||||||d||
  
        }	| j                            |g           }
t          |
          D ]-\  }}t          ||	          r|

                    ||	            n.|
                    |	           |r|t           ur0| j                            |g                               |           dS |t           ur2|0| j                            |g                               |           dS | j                            | j        g                               |           dS dS )a<  Register a fixture

        :param name:
            The fixture's name.
        :param func:
            The fixture's implementation function.
        :param nodeid:
            The visibility of the fixture (deprecated, use node instead).
            The fixture will be available to the node with this nodeid and
            its children in the collection tree. None means global visibility.
        :param node:
            The node where the fixture is defined (preferred over nodeid).
            When provided, enables node-based matching which is more robust.
        :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.
        r  rN  T)
r  rd   r   ri  rs   rR  r  r   r  rY   N)r&   rV  rW  r5   r  r  r  
setdefaultr  rq   insertr  r  r  rO   )r   r   ri  rc   rs   rR  r  r/  rY   fixture_defr  r   existings                rV   _register_fixturez FixtureManager._register_fixture  s   F 46>>M3BBBB ;
 
 
 '224<< %W-- 	( 	(KAx*8[AA q+... NN;''' 	R6!!'224<<CCDIIIIIv%%&*<)44VR@@GGMMMMM '224<DDKKDQQQQQ	R 	RrX   node_or_objc                    t                      rS   r  )r   r  s     rV   r  zFixtureManager.parsefactories  s    
 "###rX   z\parsefactories(obj, nodeid) is deprecated, use parsefactories(holder=obj, node=node) insteadr~   r   c                    t                      rS   r  )r   r  rc   s      rV   r  zFixtureManager.parsefactories       "###rX   .r'   r  c                   t                      rS   r  )r   r  rc   r  rY   s        rV   r  zFixtureManager.parsefactories  r  rX   r   nodes.Node | object | NotSetTypeobject | NotSetTypec                  t           }t           }|t           ur|}|}ny|t           u rt          d          |t           ur t          j        t          d           |}|}n8t          |t          j                  sJ t          t          |j
                  }|}t          |          s*t          |t          j                  st          |          }n|}t          |          D ]}	t!          ||	d          }
t          |
          t"          u r|
j        }|j        r|j        }n|	}	 t)          ||	          }n# t*          $ r |
}Y nw xY w|                                }|                     |||j        |j        |j        |j        ||           dS )a  Collect fixtures from a collection node or object.

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

        The preferred API uses keyword-only arguments:
        - ``holder``: The object to scan for fixtures.
        - ``node``: The node determining fixture visibility.

        Legacy positional API (translated internally):
        - ``parsefactories(node)``: Uses node.obj as holder, node for scope.
        - ``parsefactories(obj, nodeid)``: Uses obj as holder, nodeid string for scope.
        z/parsefactories() requires holder or node_or_objr  rN  N)r   ri  rs   rR  r  r/  rY   rc   )r&   r  rV  rW  r7   rb   r   Noder   r~   r}   r)   types
ModuleTypera  dirr(   r   r   r   r&  r   rH  r  rs   rR  r  r/  )r   r  rc   r  rY   effective_nodeeffective_nodeid	holderobjholderobj_tpr   obj_ubr5  r  r}   ri  s                  rV   r  zFixtureManager.parsefactories  s   , 394:I!NNF""MNNN6!!M:qIIII#I% k5:66666V[_55I(N I&& 	%z)UEU/V/V 	%#'	??LL$L	NN 	 	D ",d;;FF||8888; (#);LL#'L!!)T22CC% ! ! ! CCC! 0022&&% ,!=
"N'+ ' 	 	 	)	 	s   "D33EEr   r  c                    	 | j         |         }n# t          $ r Y dS w xY wt          |                     ||                    S )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  r  rU  r  )r   r   rY   r   s       rV   r   zFixtureManager.getfixturedefsW  sV    	/8KK 	 	 	44	T))+t<<===s    
r   Iterable[FixtureDef[Any]]Iterator[FixtureDef[Any]]c              #     K   t          |                                          }d |D             }|D ]$}|j        |j        |v r|V  |j        |v r|V  %d S )Nc                    h | ]	}|j         
S r   )rc   )r   ns     rV   	<setcomp>z1FixtureManager._matchfactories.<locals>.<setcomp>p  s    888a888rX   )r   ra   rY   rd   )r   r   rY   parent_nodesparentnodeidsr[   s         rV   r  zFixtureManager._matchfactoriesk  s       4,,..//88<888% 	! 	!J*?l22$$$$"m33    	! 	!rX   rO   r9   rP   rQ   )rY   rZ   ri  r  r   r   rP   r   )r  r+   r  r   rP   rQ   )r  r  rP   r  r   )rY   rr   rP   r   )rY   rZ   rP   r   )r  rr   r   r   r  r  rP   r  )r  rK   rP   rQ   )r   r   rP   rQ   )r   r   ri  r  rc   r  rs   r  rR  r  r  r  r/  rj   rY   r  rP   rQ   )r  rr   rP   rQ   )r  r~   rc   r   rP   rQ   )..)
r  r'   rc   r'   r  r~   rY   rr   rP   rQ   )
r  r  rc   r  r  r  rY   r  rP   rQ   )r   r   rY   rr   rP   r  )r   r  rY   rr   rP   r  )r   r   r   r   r  r  r  r.   r  r  r  r  r  r  r  r  r&   r  r   r  r!   r   r  r   rX   rV   rT   rT     sJ        <: : : :4"W "W "W "WHB B B B$ Xd   = = = = ( ( ( (	, 	, 	, 	,	! 	! 	! 	!-5 -5 -5 -5^) ) ) )Z( ( ( ( +1HR*.QU(.LR LR LR LR LR LR\ $ $ $ X$ Zf $ $ $  X$  #& $ $ $ $ X$ 9?*0M
 '-(.M M M M M M^> > > >(! ! ! ! ! !rX   rT   int | ExitCodec                0    ddl m}  || t                    S Nr   )wrap_session)_pytest.mainr  _show_fixtures_per_testr  r  s     rV   rg  rg  |  s'    ))))))< 7888rX   invocation_dirr   c                    t          t          ||                     }t          dd          }	 t          ||                    t                    z            S # t
          $ r t          | |          cY S w xY w)Nz...r{   )r   r%   r   rf  _PYTEST_DIRrh  rA   )r  ri  locprefixs       rV   _pretty_fixture_pathr    s}    
{400
1
1C%##F06COOK888999 0 0 0>3/////0s   )A A65A6testIterator[FixtureDef[object]]c              #     K   ddl m} t          | dd          }|dS t          |j                                                  D ]%\  }}|s|d         }t          ||          r!|V  &dS )a  Returns all fixtures used by the test item except for those created by
    direct parametrization and those requested dynamically with
    ``request.getfixturevalue``.

    The justification for excluding fixtures created by direct parametrization
    is that for users, they are internal implementation detail.

    Dynamically requested fixtures are excluded because they are not known
    statically.
    r   )DirectParamFixtureDefr  Nr   )r`   r  r&  r  r   r   rb   )r   r  fixture_infor   r   r[   s         rV   _get_fixtures_per_testr    s       544444 ,34+N+NL !'|'D'J'J'L'L M M   	 _
j"788 	 rX   c                
  	 dd l }|                                 | j        j        |j                            |           |                                 dfddfd	d	fd}|j        D ]} ||           d S )Nr   rP   r   c                ^    t          |           }t          t          |                    S rS   )r%   rA   r   )ri  r  r  s     rV   get_best_relpathz1_show_fixtures_per_test.<locals>.get_best_relpath  s(    $//>499555rX   r  r\   rQ   c                   | j         }dk    r|                    d          rd S t          | j                  }                    | d                               d| d                               d           t          j        | j                  }|r5t          dk    r|                    dd	
          d         n|           d S 	                    dd           d S )Nr   r   Tgreen -- yellowr  

r   maxsplit    no docstring availabler  )
r   ro   r  ri  writerb  getdocwrite_docstringr  r  )r  r   
prettypathfixture_docr  r  verboses       rV   write_fixturez._show_fixtures_per_test.<locals>.write_fixture  s   %a<<G..s33<F).+:JKK

GT***
$
$$T222
n[%566 	<a<< !!&1!55a88 	     GG0dG;;;;;rX   r   rZ   c                   t          t          |                     }|sd S                                                      dd| j                                        dd | j                   d           |D ]} |           d S )N-zfixtures used by ())r   r  r  sepr   r  )r   r   r[   r  r  r  s      rV   
write_itemz+_show_fixtures_per_test.<locals>.write_item  s    1$7788 	F
			
s3	33444
s:((77:::;;;% 	& 	&JM*%%%%	& 	&rX   r  )r  r\   rP   rQ   )r   rZ   rP   rQ   )_pytest.configperform_collectinvocation_paramsr  r  create_terminal_writerget_verbosityr   )
r  rO   r{   r  session_itemr  r  r  r  r  s
        @@@@@rV   r  r    s    -1N		.	.v	6	6B""$$G6 6 6 6 6 6< < < < < < < <&& & & & & & & &   ! !
<    ! !rX   c                0    ddl m}  || t                    S r  )r  r  _showfixtures_mainr  s     rV   rd  rd    s'    ))))))< 2333rX   c           
     .   dd l }|                                 | j        j        }|j                            |           }|                                 }|j        }g }t                      }|j	        
                                D ]\  }	}
|
J |
s|
D ]}t          |j        |          }|j        |f|v r#|                    |j        |f           |                    t!          |j                  |j        j        t'          ||j                  |j        |f           |                                 d }|D ][\  }}}}	}||k    rD|                    d          s/|                                 |                    dd|            |}|dk    r|	                    d          ro|                    |	 d           |j        dk    r |                    d	|j         d
d           |                    d| d           |                    d           t5          j        |j                  }|r4t9          ||dk    r|                    dd          d         n|           n|                    dd           |                                 ]d S )Nr   z_pytest.r  zfixtures defined from r   Tr
  r  z [z scope])cyanr  r  r  r  r   r  r  r  )r   r!  r"  r  r  r#  r$  rU   r   r  r   r%   ri  r   r   r  rp   rd   r   r  sortro   r  r  r  rs   rb  r  r  r  )r  rO   r{   r  r  r  r  r  seenr   r   r[   r  currentmodulerd   r(  r  docs                     rV   r'  r'    s   -1N		.	.v	6	6B""$$G		 BI!$D " 3 9 9 ; ;  &&& 	% 	 	Jjo~>>C"C(D00HHj(#.///
)**O.(II&   	 NNM;D  7
GZF""$$Z00 '			s=V==>>> &a<<G..s33<
GT***z))HH3**333$H???
$
$$T222
nZ_-- 	<1CIIfqI11!44#    GG0dG;;;
				) rX       r  r   r-  r  c                f    |                     d          D ]}|                     ||z              d S )Nr  )r  r  )r  r-  r  r  s       rV   r  r  	  s>    		$  
 rX   )rs   rR  r  r/  ri  r  r  r  c           	     R    |j         j                            | ||||||           dS )a  Register a fixture imperatively.

    This is an advanced function intended for use by plugins.

    Normally, fixtures should be registered declaratively using the
    :func:`@pytest.fixture <pytest.fixture>` decorator. Pytest looks for these
    fixture definitions during the collection phase and registers them
    automatically. For some plugin usecases the declarative interface can be
    cumbersome or nonviable, in which case the imperative interface can be used.

    Fixture registration is expected to happen during the collection phase, and
    this is the only sanctioned use. However, to allow for more creative uses,
    this is not enforced. But do so at your own risk!

    .. versionadded: 9.1

    :param name:
        The fixture's name.
    :param func:
        The fixture's implementation function.
    :param node:
        The visibility of the fixture.

        Only items that are descendents of this node in the collection tree will
        be able to request this fixture. You can think of this as the place
        where you would put the `@pytest.fixture`.

        For global visibility, pass the :class:`session <pytest.Session>` node,
        which is the root of the collection tree.
    :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.
    r   ri  rY   rs   rR  r  r/  N)rO   rU   r  r1  s          rV   register_fixturer2  !	  sF    ` 	L 22 3     rX   r  )rY   rZ   r[   r\   rP   r]   )rg   rh   ri   rh   rP   rj   )rY   rr   rs   rC   rP   r]   )r}   r~   rP   r   )r   rZ   rs   rC   rP   r   )r   r   rP   r   )
r   r   r   r   r   r   rs   rC   rP   r   )r   r   r   r   rP   r   )r  r  rM  r   rP   rM   r   )r  r  r  r   r  r,   rP   rD   )r[   r  rM  r   rP   r  )r[   r  rM  rH  rP   rM   )rJ  rK  rs   r.  rR  rL  r/  rj   r  rM  r   r   rP   r   ).)rJ  rQ   rs   r.  rR  rL  r/  rj   r  rM  r   r   rP   r-  rS   )rJ  rR  rs   r.  rR  rL  r/  rj   r  rM  r   r   rP   rS  )rM  r   rP   r,   )r]  r/   rP   rQ   )r  r,   rP   rm  )r   r  rq  rr  rc   r   rP   rs  )rY   rr   rP   ry  )r  r   rP   r   )r  r,   rP   r  )r  r   rP   r   )r   rZ   rP   r  )r  r,   rO   r9   rP   rQ   )r.  )r  r   r-  r   r  r   rP   rQ   )r   r   ri  r  rY   rr   rs   r.  rR  r  r  r  r/  rj   rP   rQ   )
__future__r   r  collectionsr   r   r   collections.abcr   r   r	   r
   r   r   r   r   AbstractSetdataclassesr  rb  r  pathlibr   r   r  typingr   r   r   r   r   r   r   r   r   r   rV  r{   r   _pytest._coder   r   _pytest._code.coder   r   _pytest._ior   _pytest.compatr    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r   r+   r,   r-   r.   _pytest.config.argparsingr/   _pytest.deprecatedr1   r2   r3   r4   r5   r6   r7   r8   r  r9   _pytest.markr:   r;   _pytest.mark.structuresr<   _pytest.outcomesr=   r>   r?   _pytest.pathlibr@   rA   _pytest.scoperB   rC   rD   _pytest.warning_typesrE   version_infoexceptiongrouprH   r`   rI   rJ   rK   _pytest.reportsrL   rM   r~   r2  _FixtureFuncrU  r  TracebackType_FixtureCachedResultrW   rf   rq   r|   r   	dataclassr   r   r   
OrderedSetr   r   r   r   r   ABCr   r  rH  LookupErrorr=  r  r  r  r  r  rQ  r$  r  r-  r   rP  rY  r\  rl  rp  rx  r  r  rT   rg  __file__re   r  r  r  r  rd  r'  r  r2  r   rX   rV   <module>rQ     s   " " " " " " 



 # # # # # #       # # # # # # $ $ $ $ $ $ % % % % % % $ $ $ $ $ $ $ $ $ $ $ $ # # # # # # * * * * * * $ $ $ $ $ $ . . . . . .          				       



                                                                            % % % % % %             5 5 5 5 5 5 + + + + + + & & & & & & ' ' ' ' ' ' % % % % % % ( ( ( ( ( ( * * * * * * $ $ $ $ $ $ & & & & & & ! ! ! ! ! ! % % % % % % ' ' ' ' ' ' ' ' ' ' ' ' $ $ $ $ $ $ ( ( ( ( ( ( ! ! ! ! ! ! # # # # # # # # # # # # , , , , , , - - - - - - < < < < < < 8 8 8 8 8 8 F F F F F F 8 8 8 8 8 8 A A A A A A ? ? ? ? ? ? , , , , , ,                   % % % % % % 1 1 1 1 1 1 ! ! ! ! ! ! ! ! ! ! ! ! ) ) ) ) ) ) ( ( ( ( ( ( ' ' ' ' ' ' % % % % % %       # # # # # # / / / / / / g111111  .((((((''''''''''''------ w~6663;'\)*Xc9\;R6R-SS 
	 mU04778		: $6 6 6 6   "   2   4    d###       $#$ WT]]"d(^
L L L L<   *> > > >B-, -, -, -,` d###/Y /Y /Y /Y /Y /Y /Y $#/YdG G G G GSW G G GT
 &* &* &* &* &* &* &* &*R S1 S1 S1 S1 S1 S1 S1 S1l 6R 6R 6R 6R 6R 6R 6R 6RrF F F F F\ F F FD   $
 
 
 
$   .Cd Cd Cd Cd Cd& Cd Cd CdL    
>2   .   D! ! ! !H d###'" '" '" '" '" '" '" $# '"V-& -& -& -& -& -& -& -&` 
 =@&)KN$ $ $ $ $ 
$ 
   =@&)KN          
  04H =G&*KOH H H H H HV Z  
  	   	 4 	y      4   $ $ $ $N       0F F F Ff! f! f! f! f! f! f! f!R9 9 9 9 d7#$$+0 0 0 0   <.! .! .! .!b4 4 4 46 6 6 6r     =G&*MQ8 8 8 8 8 8 8 8rX   