
    ?gN             	         S SK Jr  S SKrS SKJr  S SKJr  S SKrS SKrS SKrS SK	r	S SK
Jr  S SKrS SKrS SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJ r   S SKJ!r!  S SKJ"r"  S SKJ#r#  S SKJ$r$  S SK%r%S SK&r&S SK&J'r'  S SK(J)r)  S SK(J*r*  S SK+J,r,  S S K+J-r-  S S!K.J/r/  S S"K0J1r1  S S#K0J2r2  S S$K0J3r3  S S%K0J4r4  S S&K0J5r5  S S'K0J6r6  S S(K0J7r7  S S)K0J8r8  S S*K0J9r9  S S+K0J:r:  S S,K0J;r;  S S-K0J<r<  S S.K=J>r>  S S/K=J?r?  S S0K=J@r@  S S1KAJBrB  S S2KCJDrD  S S3KCJErE  S S4KCJFrF  S S5KGJHrH  S S6KIJJrJ  S S7KIJKrK  S S8KLJMrM  S S9KNJOrO  S S:KNJPrP  S S;KNJQrQ  S S<KRJSrS  S S=KRJTrT  S S>KUJVrV  S S?KUJWrW  S S@KUJXrX  \R                  SA:  a  S SBKZJ[r[  \"(       a  S SCK\J]r]  S SDK\J^r^  S SEK\J_r_  \#" SF5      r`\#" SG\SH\a4   SI9rb\$\SH\`4   \SH\\`SS4   4   4   rc\$\!\`\aS4   \!S\a\!\d\\R                     4   4   4   rf\R                  " SJSK9 " SL SM\\`   5      5       rhSSO jri      SSP jrjSSQ jrkSSR jrl\R                  " SJSK9 " SS ST5      5       rm\#" SU5      rn\\nS4   ro      SSV jrpSSW jrq          SSX jrr\R                  " SJSK9 " SY SZ5      5       rs " S[ S\\R                  5      ru\ " S] S^\u5      5       rv\ " S_ S`\u5      5       rw\ " Sa Sb\x5      5       ry " Sc Sd\-5      rz      SSe jr{SSf jr|        SSg jr}\ " Sh Si\\`   5      5       r~      SSj jr      SSk jr      SSn jr\\R                  " SJSK9 " So Sm5      5       5       r\SHSHSHSHSHSp.             SSq jj5       r\ SSHSHSHSHSSp.             SSr jjj5       r SSlSSsSSSp.             SSt jjjr SSlSSsSSSp.Su jjr\" SNSv9SSw j5       rSSx jrSSy jrSSz jrSS{ jr " S| S}5      rSS~ jr\" \&GR                  5      GR                  rSS jrSS jrSS jrSS jrSSS jjrg)    )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                  *    \ rS rSr% S\S'   S\S'   Srg)PseudoFixtureDefs   z"_FixtureCachedResult[FixtureValue]cached_resultrC   _scope N__name__
__module____qualname____firstlineno____annotations____static_attributes__rS       2/usr/lib/python3/dist-packages/_pytest/fixtures.pyrO   rO   s   s    55Mr[   rO   sessionc                $    [        U 5      U l        g N)FixtureManager_fixturemanager)r]   s    r\   pytest_sessionstartrb   y   s    ,W5Gr[   c                    SSK Jn  U R                  5        H3  n[        X25      (       d  M  UR                  UR
                  :X  d  M1  Us  $    U R                  $ )Nr   )Package)_pytest.pythonrd   iter_parents
isinstancenodeidbaseidr]   )node
fixturedefrd   parents       r\   get_scope_packagerm   }   sG     '##%f&&6==J<M<M+MM & <<r[   c                F   SS K nU[        R                  L a  U R                  [        R
                  5      $ U[        R                  L a%  U R                  UR                  R                  5      $ U[        R                  L a%  U R                  UR                  R                  5      $ U[        R                  L a%  U R                  UR                  R                  5      $ U[        R                  L a%  U R                  UR                  R                  5      $ [        U5        g Nr   )re   rC   rH   	getparentr   ItemClasspythonModulerd   r7   mainr$   )rj   scope_pytests      r\   get_scope_noderx      s     ~~ejj))	%++	~~gnn2233	%,,	~~gnn3344	%--	~~gnn4455	%--	~~gll2233Ur[   c                F    [        [        [           [        U SS5      5      $ )zFReturn fixturemarker or None if it doesn't exist or raised
exceptions._pytestfixturefunctionN)r
   r   FixtureFunctionMarkerr-   )objs    r\   getfixturemarkerr}      s'     &'S2D9 r[   c                  >    \ rS rSr% S\S'   S\S'   S\S'   S\S	'   S
rg)FixtureArgKey   strargnameintparam_indexzPath | Nonescoped_item_pathtype | Noneitem_clsrS   NrT   rS   r[   r\   r   r      s    L!!r[   r   _Vc              #  .  #    U[         R                  Ld   e U R                  nSnU[         R                  L a  SnOU[         R
                  L a  U R                  R                  nOWU[         R                  L a  U R                  nO7U[         R                  L a  U R                  nU R                  nO[        U5        UR                   H6  nUR                  U   U:w  a  M  UR                  U   n[        XVWU5      v   M8     g! [         a     gf = f7f)zSReturn list of keys for all parametrized arguments which match
the specified scope.N)rC   rH   callspecAttributeErrorr7   rd   pathrl   rt   rr   clsr$   indices
_arg2scoper   )itemrv   r   r   r   r   r   s          r\    get_parametrized_fixture_argkeysr      s     
 &&&"mm H	%--	99++	%,,	99	%++	9988U##w'50&&w/G2BHMM	 $#  s(   DD C D
DDDDc                P   0 n0 n[          H`  n0 =oAU'   [        [        5      =oRU'   U  H>  n[        R	                  [        Xc5      5      nU(       d  M*  XtU'   U H
  nS XX   U'   M     M@     Mb     [        R	                  U 5      n	[        [        XU[        R                  5      5      $ r_   )
rB   r   r   dictfromkeysr   listreorder_items_atscoperC   r7   )
itemsargkeys_by_itemitems_by_argkeyrv   scoped_argkeys_by_itemscoped_items_by_argkeyr   argkeysargkey	items_sets
             r\   reorder_itemsr      s    PRO 	  :<<!7:Ek:RR!7Dmm$DT$QRGw/6t,%F;?*248 &	   e$I	
 r[   c                N  ^ U[         R                  L d  [        U 5      S:  a  U $ X#   nX   n[        5       m[	        U 5      n0 nU(       GaS  0 nS n	U(       a  UR                  5       n
X;   d  X;   a  M#  [        R                  U4S jUR                  U
S5       5       5      nU(       d  S X'   OUR                  5       u  pXI    Vs/ s H  oU ;   d  M
  UPM     nn[        U5       H[  nUR                  U5        [         H=  nX/   nX   R                  US5       H  nS UU   U'   UU   R                  USS9  M      M?     M]     O	U(       a  M  U(       a+  [        XX#R                  5       5      nUR!                  U5        U	b  TR#                  U	5        U(       a  GMS  U$ s  snf )NrD   c              3  6   >#    U  H  oT;  d  M
  Uv   M     g 7fr_   rS   ).0kignores     r\   	<genexpr>(reorder_items_atscope.<locals>.<genexpr>  s      $?aF??s   		rS   F)last)rC   rH   lensetr   popleftr   r   getpopitemreversed
appendleftrB   move_to_endr   
next_lowerupdateadd)r   r   r   rv   r   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                      @r\   r   r      s    #e*q.,3,3!$F,K)+J
24&&(D!T%<mm $155dB?$ G (,%$+OO$5!  6E"E!eAE  " ".1A**1-'27F7S4&5&B&F&Fq"&MFFJ8@C8@LL ! M  'N (3 2 5 k6 (=/CSCSCU)% 78%JJ~&I +J +"s   	F"F"c                  P    \ rS rSr% SrSrS\S'   S\S'   S\S'   S	\S
'   SS jrSrg)FuncFixtureInfoi(  a  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                   [        5       n[        U R                  5      nU(       ax  UR                  5       nX1;  aZ  X0R                  ;   aK  UR	                  U5        X0R
                  ;   a+  UR                  U R
                  U   S   R                  5        U(       a  Mx  [        XR                  R                  S9U R                  SS& g)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       r\   prune_dependency_tree%FuncFixtureInfo.prune_dependency_treeG  s      E$++,!oo'G %'5G5G*GG$333&&t'<'<W'Eb'I'R'RS k !'w4F4F4L4L M1r[   rS   NreturnNone)	rU   rV   rW   rX   __doc__	__slots__rY   r   rZ   rS   r[   r\   r   r   (  s5    
 RI  "! 
 ;:Nr[   r   c                     \ rS rSrSrSS.           SS jjr\SS j5       r\\R                  S S j5       5       r
\S!S j5       r\R                        S"S	 j5       r\S#S
 j5       r\\R                  S 5       5       r\S$S j5       r\S 5       r\S 5       r\S 5       r\S 5       r\S%S j5       r\S&S j5       r\S'S j5       r\R                  S(S j5       rS)S jrS*S jrS+S jrS,S jr    S-S jrS.S jrS/S jrSrg)0FixtureRequestic  zThe 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               N    [        U5        X l        Xl        X0l        X@l        U   g r_   )r4   fixturename_pyfuncitem_arg2fixturedefs_fixture_defs)r   
pyfuncitemr   arg2fixturedefsfixture_defsr   s         r\   __init__FixtureRequest.__init__j  s-     	y!"-",
 (7 %1 	r[   c                B    U R                   R                  R                  $ r_   )r   r]   ra   r   s    r\   ra   FixtureRequest._fixturemanager  s    ''777r[   c                    [        5       er_   NotImplementedErrorr   s    r\   rR   FixtureRequest._scope  s     "##r[   c                .    U R                   R                  $ zIScope string, one of "function", "class", "module", "package", "session".rR   valuer   s    r\   rv   FixtureRequest.scope       {{   r[   c                    [        5       er_   r   r   requested_fixturedefrequested_scopes      r\   _check_scopeFixtureRequest._check_scope       "##r[   c                    [        U R                  R                  5      nUR                  [	        U R
                  5      R                  U5      5        U$ )z-Names of all active fixtures in this request.)r   r   fixturenamesextendr   r   
difference)r   results     r\   r   FixtureRequest.fixturenames  sA     d&&334c$,,-88@Ar[   c                    [        5       e)z>Underlying collection node (depends on current request scope).r   r   s    r\   rj   FixtureRequest.node       "##r[   c                .    U R                   R                  $ )z6The pytest config object associated with this request.)r   configr   s    r\   r  FixtureRequest.config  s     &&&r[   c                    U R                   S:w  a  [        SU R                    S35      eU R                  R                  $ )z=Test function object if the request has a per-function scope.functionzfunction not available in -scoped context)rv   r   r   r|   r   s    r\   r  FixtureRequest.function  sA     ::# ,TZZLH  ###r[   c                    U R                   S;  a  [        SU R                    S35      eU R                  R                  [        R
                  R                  5      nU(       a  UR                  $ g)z:Class (can be None) where the test function was collected.)classr  zcls not available in r  N)rv   r   r   rp   rw   rs   rr   r|   )r   clscols     r\   r   FixtureRequest.cls  s\     ::22 #8O!TUU!!++GNN,@,@A:: r[   c                R    U R                   S:w  a  g[        U R                  SS5      $ )z<Instance (can be None) on which test function was collected.r  Ninstance)rv   getattrr   r   s    r\   r  FixtureRequest.instance  s(     ::#t''T::r[   c                    U R                   S;  a  [        SU R                    S35      eU R                  R                  [        R
                  R                  5      nUc   eUR                  $ )z;Python module object where the test function was collected.)r  r	  modulezmodule not available in r  )rv   r   r   rp   rw   rs   rt   r|   )r   mods     r\   r  FixtureRequest.module  s]     ::<< #;DJJ<!WXX(()>)>?wwr[   c                    U R                   S;  a  [        SU R                    S35      eU R                  R                  $ )z+Path where the test function was collected.)r  r	  r  packagezpath not available in r  )rv   r   r   r   r   s    r\   r   FixtureRequest.path  s<     ::GG #9$**_!UVV$$$r[   c                2    U R                   nUR                  $ )z4Keywords/markers dictionary for the underlying node.)rj   keywords)r   rj   s     r\   r  FixtureRequest.keywords  s      99}}r[   c                .    U R                   R                  $ )zPytest session object.)r   r]   r   s    r\   r]   FixtureRequest.session  s     '''r[   c                    [        5       e)zAdd finalizer/teardown function to be called without arguments after
the last test within the requesting test context finished execution.r   r   	finalizers     r\   addfinalizerFixtureRequest.addfinalizer  r   r[   c                :    U R                   R                  U5        g)zApply 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)rj   
add_marker)r   markers     r\   applymarkerFixtureRequest.applymarker  s     			V$r[   c                    [        SX5      e)zYRaise a FixtureLookupError exception.

:param msg:
    An optional custom error message.
N)FixtureLookupError)r   msgs     r\   
raiseerrorFixtureRequest.raiseerror  s     !t11r[   c                r    U R                  U5      nUR                  c   SU S35       eUR                  S   $ )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.
zThe fixture value for "zQ" is not available.  This can happen when the fixture has already been torn down.r   )_get_active_fixturedefrQ   )r   r   rk   s      r\   getfixturevalueFixtureRequest.getfixturevalue  sS    , 009
''3 	
%gY /K K	
3 ''**r[   c              #     #    U n[        U[        5      (       a(  Uv   UR                  n[        U[        5      (       a  M'  gg7f)zZYield all SubRequests in the chain, from self up.

Note: does *not* yield the TopRequest.
N)rg   
SubRequest_parent_request)r   currents     r\   _iter_chainFixtureRequest._iter_chain  s8     
 *--M--G *--s   =AAc           	        US:X  a   U S/S 4n[        U[        R                  5      $ U R                  R	                  U5      nUb  U R                  X3R                  5        U$ U R                  R	                  US 5      nUc6  U R                  R                  XR                  5      nUb  X@R                  U'   Uc  [        X5      eU(       d  [        X5      eSnU R                  5        H  nUR                  U:X  d  M  US-  nM     U* [        U5      :  a  [        X5      eXE   n U R                  R                  nUb=  XR"                  ;   a.  UR"                  U   nUR$                  U   n	UR&                  U   n
O%[(        nSn	UR                  n
U R+                  U5        U R                  X:5        [-        X
XUSS9nUR/                  US9  X0R                  U'   U$ ! [          a    S n Nf = f)Nrequestr   r      Tr   r6  )rO   rC   rH   r   r   r   rR   r   ra   getfixturedefsr   r'  r3  r   r   r   r   paramsr   r   r+   _check_fixturedef_without_paramr0  execute)r   r   rQ   rk   fixturedefsr   r6  r   paramr   rv   
subrequests               r\   r,  %FixtureRequest._get_active_fixturedef%  s    i!A3-M#M5>>BB ''++G4
!j*;*;< ++//> ..==gGWGWXK&1<%%g.$W33$W33 '')G""g-
 * 6C$$$W33 '
	''00H G$>OOG,E"**73K''0EEK%%E00<*,Z4


 	:.&07#+  	H	s   'G G-,G-c           
        U R                   nUR                  SLn[        USS5      nU(       aB  U(       a;  UR                   SUR                   S[        U5      R                   3n[        USS9  U(       a  [        R                  " 5       S   n[        R                  " US   5      n[        UR                  5      nUR                  n	 [        UR                  UR                   R"                  5      5      n
['        UR(                  UR                   R"                  5      nS	UR                   S
UR*                   SU SU
 SU	 3
n[        USS9  gg! [$         a    [        U5      n
 Nrf = f)zNCheck 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: pytracerD   r   z=The requested fixture has no parameter defined for test:
    z

Requested fixture 'z' defined in:
z

Requested here:
:)r   r:  r  namerh   typerU   r<   inspectstackgetframeinfor?   filenamelinenor   relative_tor  rootpath
ValueErrorr)   funcr   )r   rk   funcitem
has_paramsfixtures_not_supportedr(  frame	frameinfosource_pathsource_linenosource_path_strlocations               r\   r;  .FixtureRequest._check_fixturedef_without_paramn  sg    ##&&d2
!(<!G0==/ "$OO, -""&x."9"9!:< 
 e$MMOA&E,,U1X6I&y'9'9:K%,,M3"%k&=&=hoo>V>V&W"X #:??HOO4L4LMH' (&&0&8&8%9* $"#1]O5  e$%   3"%k"23s   .E E,+E,c                    U R                  5        Vs/ s H  oR                  PM     nnUR                  5         U$ s  snf r_   )r3  _fixturedefreverse)r   r6  valuess      r\   _get_fixturestack FixtureRequest._get_fixturestack  s:    595E5E5GH5G'%%5GH Is   <)r   r   r   r   N)r   rH   r   
str | Noner   r   r   zdict[str, FixtureDef[Any]]r   boolr   r   )r   r`   r   rC   r   rA   r   -FixtureDef[object] | PseudoFixtureDef[object]r   rC   r   r   )r   r   )r   r0   )r   r   )r   zMutableMapping[str, Any])r   r7   r  zCallable[[], object]r   r   )r#  zstr | MarkDecoratorr   r   )r(  ra  r   r   )r   r   r   r   )r   zIterator[SubRequest])r   r   r   rf  )rk   FixtureDef[object]r   r   )r   zlist[FixtureDef[Any]]) rU   rV   rW   rX   r   r   propertyra   abcabstractmethodrR   rv   r   r   rj   r  r  r   r  r  r   r  r]   r  r$  r)  r-  r3  r,  r;  r_  rZ   rS   r[   r\   r   r   c  s        >	
 1  
> 8 8 $  $ ! ! 	$K$ $ 
	$ $   $  $ ' ' $ $   ; ;   % %  
 ( ( 	$ $
	%2+:.GG	6GR%Br[   r   c                     ^  \ rS rSrSrSS.SU 4S jjjr\SS j5       r      SS jr\S 5       r	SS	 jr
SS
 jrSS jrSrU =r$ )
TopRequesti  z7The type of the ``request`` fixture in a test function.Fr   c               l   > [         TU ]  S UUR                  R                  R	                  5       0 US9  g )N)r   r   r   r   r   )superr   _fixtureinfor   copy)r   r   r   	__class__s      r\   r   TopRequest.__init__  s9    !&33DDIIK 	 	
r[   c                "    [         R                  $ r_   )rC   rH   r   s    r\   rR   TopRequest._scope  s    ~~r[   c                    g r_   rS   r   s      r\   r   TopRequest._check_scope  s     	r[   c                    U R                   $ r_   )r   r   s    r\   rj   TopRequest.node  s    r[   c                $    SU R                   < S3$ )Nz<FixtureRequest for >)rj   r   s    r\   __repr__TopRequest.__repr__  s    %dii]!44r[   c                    U R                   nUR                   H2  nX!R                  ;  d  M  U R                  U5      UR                  U'   M4     g r_   )r   r   funcargsr-  )r   r   r   s      r\   _fillfixturesTopRequest._fillfixtures  s@    ((Gmm+)-)=)=g)Fg& )r[   c                :    U R                   R                  U5        g r_   )rj   r  r  s     r\   r  TopRequest.addfinalizer  s    		y)r[   rS   )r   rH   r   rb  r   r   rc  re  r   r   r   rg  )rU   rV   rW   rX   r   r   ri  rR   r   rj   r|  r  r  rZ   __classcell__rr  s   @r\   rm  rm    sq    ABG 
 
  K  
	    5G* *r[   rm  c                     ^  \ rS rSrSrSS.             SU 4S jjjrSS jr\SS j5       r\S 5       r	      SS	 jr
SS
 jrSS jrSrU =r$ )r0  i  zfThe type of the ``request`` fixture in a fixture function requested
(transitively) by a test function.Fr   c                  > [         TU ]  UR                  UR                  UR                  UR
                  US9  Xl        X l        XPl        U[        La  X0l
        X@l        g )N)r   r   r   r   r   )ro  r   r   r   r   r   r1  _scope_fieldr\  r+   r>  r   )r   r6  rv   r>  r   rk   r   rr  s          r\   r   SubRequest.__init__  se     	**"** ..#44 	 	
 7>#(6@J"-r[   c                @    SU R                   < SU R                  < S3$ )Nz<SubRequest z for r{  )r   r   r   s    r\   r|  SubRequest.__repr__  s%    d..1t7G7G6J!LLr[   c                    U R                   $ r_   )r  r   s    r\   rR   SubRequest._scope  s       r[   c                t   U R                   nU[        R                  L a  U R                  nOJU[        R                  L a!  [        U R                  U R                  5      nO[        U R                  U5      nUc  U[        R                  L a  U R                  nU(       d   SU SU R                  < 35       eU$ )Nz#Could not obtain a node for scope "z" for function )	rR   rC   rH   r   rd   rm   r\  rx   rr   )r   rv   rj   s      r\   rj   SubRequest.node  s    ENN"&*&6&6Demm#$T%5%5t7G7GHD!$"2"2E:D<EU[[0##De:5'QUQaQaPdeetr[   c                N  ^  [        U[        5      (       a  g T R                  U:  a~  UR                  nSR	                  U 4S jT R                  5        5       5      nT R                  U5      n[        SUR                   SU ST R                  R                   SU SU 3
SS	9  g g )
N
c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr_   )_format_fixturedef_line)r   rk   r   s     r\   r   *SubRequest._check_scope.<locals>.<genexpr>  s&      &":J ,,Z8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:
FrC  )	rg   rO   rR   r   joinr_  r  r<   r   )r   r   r   r   fixture_stackrequested_fixtures   `     r\   r   SubRequest._check_scope  s    
 *,<==;;(*22G II &"&"8"8":& M !% < <=Q R9/:O:O9P Q")8DKK,=,=+> ?..;_ =''8&9;  )r[   c                   UR                   n[        U5      u  p4[        U[        5      (       a*  [	        U R
                  R                  R                  U5      n[        R                  " U5      nU SUS-    SUR                   U 3$ )NrE  r7  z:  def )rP  r   rg   r   r@   r   r]   r   rH  	signaturerU   )r   rk   factoryr   rL  r  s         r\   r  "SubRequest._format_fixturedef_line
  sx    //"7+dD!!t//77<<dCD%%g.	q!GG,<,<+=i[IIr[   c                :    U R                   R                  U5        g r_   )r\  r  r  s     r\   r  SubRequest.addfinalizer  s    %%i0r[   )r\  r1  r  r>  r   )r6  r   rv   rC   r>  r   r   r   rk   rh  r   rb  r   r   r  rc  re  )rk   rh  r   r   rg  )rU   rV   rW   rX   r   r   r|  ri  rR   rj   r   r  r  rZ   r  r  s   @r\   r0  r0    s    *  .. . 	.
 . '. . 
. .0M ! !  K  
	.J1 1r[   r0  c                  @    \ rS rSrSr S       SS jjrS	S jrSrg)
r'  i  z:Could not return a requested fixture (missing or invalid).Nc                R    Xl         X l        UR                  5       U l        X0l        g r_   )r   r6  r_  fixturestackr(  )r   r   r6  r(  s       r\   r   FixtureLookupError.__init__  s$     #557r[   c                   / nUR                   nU R                  R                  R                  /nUR	                  [        S U R                  5      5        U R                  nUb  US S nU H  n[        U5      u  pg [        R                  " [        U5      5      u  pU" SU SUS-    35        [        U5       HG  u  pUR                  5       nU" SU-   5        UR                  5       R                  S5      (       d  MF    M     M     UGc   U R                  R&                  n[)        5       nU R                  R                  R*                  nUc   eUR,                  R/                  5        H;  u  nn[1        UR3                  UU5      5      nU(       d  M*  UR5                  U5        M=     U R6                  U;   a  S	U R6                   S
3nOSU R6                   S3nUSR9                  SR;                  [=        U5      5      5      -  nUS-  n[?        WWXU R6                  5      $ ! [         ["        [$        4 a    SnU" XUS-   4-  5         GM  f = f)Nc                    U R                   $ r_   )rP  )xs    r\   <lambda>/FixtureLookupError.formatrepr.<locals>.<lambda>&  s    166r[   r   zfile z, line r7  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.) appendr6  r   r|   r   mapr  r(  r   rH  getsourcelinesr%   	enumeraterstriplstrip
startswithOSError
IndexError	TypeErrorra   r   rl   r   r   r   _matchfactoriesr   r   formatr  r   FixtureLookupErrorRepr)r   tblinesaddlinerI  r(  r  fspathrL  linesr   r   line	error_msgfm	availablerl   rF  r=  faclists                      r\   
formatreprFixtureLookupError.formatrepr"  s    ..))--.S)4+<+<=>hh? #2JEH(2NF"11-2IJ
 %xwvzl;<(/GA;;=DD4K({{}//66	  0  ;--BI\\--44F%%%%'%8%8%>%>%@!kr11+vFG7MM$' &A ||y(?~ZX  "$,,{;.55diiy@Q6RSSCLLC%ffgDLLQQ; Z3 :I		VaZ$8899:s   =!H%%&II)r   r  r(  r6  r_   )r   ra  r6  r   r(  ra  r   r   )r   r  )rU   rV   rW   rX   r   r   r  rZ   rS   r[   r\   r'  r'    s7    D OS!,:AK	+Rr[   r'  c                  @    \ rS rSr            SS jrSS jrSrg)r  iP  c                @    X0l         X@l        Xl        X l        XPl        g r_   )r  errorstringrK  firstlinenor   )r   rK  r  r  r  r   s         r\   r   FixtureLookupErrorRepr.__init__Q  s     & &r[   c                0   U R                    H"  nUR                  UR                  5       5        M$     U R                  R	                  S5      nU(       aq  UR                  [
        R                   SUS   R                  5        3SS9  USS   H4  nUR                  [
        R                   SUR                  5        3SS9  M6     UR                  5         UR                  S[        R                  " U R                  5      U R                  S-   4-  5        g )Nr  z       r   Tredr7  z%s:%d)r  r  r  r  splitr    fail_markerstripflow_markerosr  rK  r  )r   twtbliner  r  s        r\   
toterminal!FixtureLookupErrorRepr.toterminal_  s    llFGGFMMO$ #  &&t,GG#//0a8H7IJ   ab	'334GDJJL>J   "
 		
299T]]3T5E5E5IJJKr[   )r   r  rK  r  r  N)rK  zstr | os.PathLike[str]r  r   r  Sequence[str]r  r   r   ra  r   r   )r  r"   r   r   )rU   rV   rW   rX   r   r  rZ   rS   r[   r\   r  r  P  sG    (  	
   
Lr[   r  c                   [        U 5      (       ae  [        [        S[        [        S S 4   4   U 5      n U " S0 UD6n [        U5      n[        R                  " [        X5      nUR                  U5        U$ [        [        S[        4   U 5      n U " S0 UD6nU$ ! [         a    [        UR                   S35      S ef = f)N.z did not yield a valuerS   )r*   r
   r	   r   rJ   nextStopIterationrO  r   	functoolspartial_teardown_yield_fixturer  )fixturefuncr6  kwargs	generatorfixture_resultr  s         r\   call_fixture_funcr  r  s     K  S)L$$<==>
  )&)		W!)_N %%&={V	Y'  8C$56D$.v.  	W 3 344JKLRVV	Ws   B $B=c           	          [        U5        [        U 5      u  p#[        S[        U 5      R	                  5        SU SUS-    3SS9  g! [
         a     gf = f)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  rE  r7  FrC  N)r  r   r<   r   indentr  )r  itfsrL  s       r\   r  r    sj    
R !-
=k"))+,Bd!FQJ<! 		
	  s   A 
AAc                     U " XS9n[        U[        5      (       d  [	        SU  SU SU< 3SS	9  U$ ! [          a  n[        SU  SU S35      UeS nAff = f)
N)fixture_namer  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:
FrC  )	Exceptionr  rg   r   r<   )scope_callabler  r  r   es        r\   _eval_scope_callabler    s    
  \I fc""''RS_R``uj	

 M  //H WO O
 	s   3 
AAAc                      \ rS rSrSr SSS.                 SS jjjr\SS j5       rSS jrSS	 jr	SS
 jr
SS jrSS jrSrg)
FixtureDefi  zA container for a fixture definition.

Note: At this time, only explicitly documented fields and methods are
considered public stable API.
NFr   c                  [        U5        U=(       d    SU l        US LU l        X@l        X0l        Uc  [
        R                  nO[        U5      (       a  [        XSU5      n[        U[        5      (       a$  [
        R                  " USUR                   S3US9nXPl        X`l        Xpl        [!        XCS9U l        S U l        / U l        g )N z	Fixture '')descrwhererF  )r4   ri   has_locationrP  r   rC   rH   callabler  rg   r   	from_userrU   rR   r:  idsr'   r   rQ   _finalizers)	r   r  ri   r   rP  rv   r:  r  r   s	            r\   r   FixtureDef.__init__  s     	y! $\r $*#5	%=NNEe__(@EeS!!OOyq9E ## .tB IM>@r[   c                .    U R                   R                  $ r   r   r   s    r\   rv   FixtureDef.scope  r   r[   c                :    U R                   R                  U5        g r_   )r  r  r  s     r\   r  FixtureDef.addfinalizer  s    	*r[   c                   / nU R                   (       a5  U R                   R                  5       n U" 5         U R                   (       a  M5  UR                  nUR
                  R                  XS9  S U l        U R                   R                  5         [        U5      S:X  a  US   e[        U5      S:  a#  SU R                   SU 3n[        XbS S S2   5      eg ! [         a  nUR                  U5         S nANS nAff = f)Nrk   r6  r7  r   z#errors while tearing down fixture "z" of r   )r  r   BaseExceptionr  rj   ihookpytest_fixture_post_finalizerrQ   clearr   r   rF   )r   r6  
exceptionsfinr  rj   r(  s          r\   finishFixtureDef.finish  s    *,
""&&(C%  ||

00D0R " z?aQ-_q 7~U4&QC$STrT*:;; ! ! %!!!$$%s   C 
C; C66C;c                R   / nU R                    H<  nUR                  U5      n[        U[        5      (       a  M+  UR	                  U5        M>     U R
                  b  U R                  U5      nU R
                  S   n [        XV:H  5      nU(       aC  U R
                  S   b"  U R
                  S   u  pUR                  U	5      eU R
                  S   n
U
$ U R                  U5        U R
                  b   e[        R                  " U R                  US9nU H  nUR                  U5        M     UR                  R                   n UR#                  XS9n
UR                  R                  U5        U
$ ! [        [        4 a    XVL n Nf = f! UR                  R                  U5        f = f)z=Return the value of this fixture, executing it if not cached.r7     r   r8  r  )r   r,  rg   rO   r  rQ   	cache_keyrb  rO  RuntimeErrorwith_tracebackr  r  r  r  rj   r  pytest_fixture_setup)r   r6  *requested_fixtures_that_should_finalize_usr   rk   request_cache_keyr  	cache_hitexcexc_tbr   r  parent_fixturer  s                 r\   r<  FixtureDef.execute  s    682}}G 77@J j*:;;:AA*M % ) $w 7**1-I; !!2!?@	
 %%a(4"&"4"4Q"7KC,,V44!//2F!M KK %%---
 %%dkk7C	HN''	2 I ""	1 //4/QF LL%%i0A - ;-:	;< LL%%i0s   =E0 F	 0FF	F&c                    [        USS 5      $ )Nr>  )r  )r   r6  s     r\   r  FixtureDef.cache_keyJ  s    w..r[   c                \    SU R                   < SU R                  < SU R                  < S3$ )Nz<FixtureDef argname=z scope=z baseid=r{  )r   rv   ri   r   s    r\   r|  FixtureDef.__repr__M  s/    %dll%5WTZZN(SWS^S^Raabccr[   )
r  rR   r   r   ri   rQ   rP  r  r  r:  r_   )r  r0   ri   ra  r   r   rP  _FixtureFunc[FixtureValue]rv   z?Scope | _ScopeName | Callable[[str, Config], _ScopeName] | Noner:  Sequence[object] | Noner  Atuple[object | None, ...] | Callable[[Any], object | None] | Noner   rb  r   r   rd  rg  )r6  r0  r   r   )r6  r0  r   rJ   )r6  r0  r   objectr  )rU   rV   rW   rX   r   r   ri  rv   r  r  r<  r  r|  rZ   rS   r[   r\   r  r    s     RV7A  7A7A 7A 	7A
 )7A O7A (7A O7A 7A 
7Ar ! !+<*;z/dr[   r  c                   U R                   nUR                  nUbm  [        US5      (       a'  [        UUR                  R
                  5      (       d  U$ [        U R                   5      nX R                   :w  a  UR                  U5      nU$ )zGGet the actual callable that can be called to obtain the fixture
value.__self__)rP  r  hasattrrg   r  rr  r(   __get__)rk   r6  r  r  s       r\   resolve_fixture_functionr  Q  s    
 //K H ;
++J  **5
 5
 
0//)%--h7Kr[   c                V   0 nU R                    H  nUR                  U5      X#'   M     [        X5      nU R                  U5      n [	        XAU5      nXeS4U l        U$ ! [
         aA  n[        U[        R                  5      (       a  SUl	        SXWUR                  44U l        e SnAff = f)zExecution of fixture setup.TN)r   r-  r  r  r  r>   rg   r=   r  _use_item_location__traceback__rQ   )rk   r6  r  r   r  my_cache_keyr   r  s           r\   r
  r
  i  s     F&&!11': ' +:?K''0L	";@ !'d;JM  a(( $(A $(,AOO8L#M
 s   A 
B('<B##B(r  r{   c                   ^ UR                   =(       d    U R                  nSU S3m[        R                  " U 5      U4S j5       n[	        U 5      Ul        [        [        U5      $ )zWrap 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SS9  g )NFrC  r;   )argsr  messages     r\   r   =wrap_function_to_error_out_if_called_directly.<locals>.result  s    We$r[   )rF  rU   r  wrapsr#   __pytest_wrapped__r
   rK   )r  fixture_markerrF  r   r&  s       @r\   -wrap_function_to_error_out_if_called_directlyr+    sl     3("3"3D
D6 w 	w  __X% %
 !/x 8F((r[   c                  v    \ rS rSr% S\S'   S\S'   SrS\S'   S	rS
\S'   S	rS\S'   SrS\S'   SS jr	SS jr
Srg	)r{   i  0_ScopeName | Callable[[str, Config], _ScopeName]rv   ztuple[object, ...] | Noner:  Frb  autouseNr  r  ra  rF  zdataclasses.InitVar[bool]r   c                    [        U5        g r_   r3   )r   r   s     r\   __post_init__#FixtureFunctionMarker.__post_init__  s
    y!r[   c                   [         R                  " U5      (       a  [        S5      e[        USS5      (       a  [        SUR                  < 35      e[        US5      (       a  [        R                  " [        SS9  [        X5      nU R                  =(       d    UR                  nUS:X  a  [        U5      n[        S	U 3SS
9  Xl        U$ )Nz2class fixtures not supported (maybe in the future)rz   FzE@pytest.fixture is being applied more than once to the same function 
pytestmarkr  
stacklevelr6  z?'request' is a reserved word for fixtures, use another name:
  rC  )rH  isclassrO  r  rU   r  warningswarnr5   r+  rF  r)   r<   rz   )r   r  rF  rY  s       r\   __call__FixtureFunctionMarker.__call__  s    ??8$$QRR85u==WX`XiXiWlm  8\**MM.Q7@Pyy-H--9"8,HRS[R\] +/'r[   rS   )r   rb  r   r   )r  rK   r   rK   )rU   rV   rW   rX   rY   r.  r  rF  r   r0  r9  rZ   rS   r[   r\   r{   r{     sD     <;%%GTMQC	JQD*+0I(0"r[   rv   r:  r.  r  rF  c                   g r_   rS   fixture_functionrv   r:  r.  r  rF  s         r\   fixturer?    s     r[   c                   g r_   rS   r=  s         r\   r?  r?    s      r[   Fc          	         [        UUb  [        U5      OSUUc  SO[        U5      (       a  UO
[        U5      USS9nU (       a  U" U 5      $ U$ )aE  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)rv   r:  r.  r  rF  r   )r{   tupler  )r>  rv   r:  r.  r  rF  r*  s          r\   r?  r?    sW    v + & 2uV}KDHSMMSuSzN .//r[   c          	     Z    [         R                  " [        SS9  [        U /UQ7UUUUUS.6$ )z(Return a) decorator to mark a yield-fixture factory function.

.. deprecated:: 3.0
    Use :py:func:`pytest.fixture` directly instead.
r  r4  r;  )r7  r8  r6   r?  )r>  rv   r:  r.  r  rF  r%  s          r\   yield_fixturerD  &  s@     MM-A.	  r[   )rv   c                    U R                   $ )zSession-scoped fixture that returns the session's :class:`pytest.Config`
object.

Example::

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

r  r8  s    r\   pytestconfigrG  @  s     >>r[   c           	         U R                  SS/ SS9  U R                  S5      nUR                  SSSS	S
SS9  UR                  SSSS
SS9  g )Nusefixturesr%  z5List of default fixtures to be used with this project)rG  defaulthelpgeneralz
--fixturesz
--funcargs
store_trueshowfixturesFziShow available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v'))actiondestrJ  rK  z--fixtures-per-testshow_fixtures_per_testzShow fixtures per test)addinigetgroup	addoption)parsergroups     r\   pytest_addoptionrW  O  sv    
MMD	   OOI&E	OO?   
OO%%  r[   c                    U R                   R                  (       a  [        U 5        gU R                   R                  (       a  [        U 5        gg ro   )optionrN  rQ  rF  s    r\   pytest_cmdline_mainrZ  i  s5    }}!!V}}++v&r[   c                   [        5       nU R                  SS9 Hc  nUR                  R                  SS5      (       a  M&  [        R
                  " UR                  0 UR                  D6u  p4UR                  U5        Me     U$ )zReturn 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   )rj   parametrize_argnamesr#  
p_argnamesr   s        r\   _get_direct_parametrize_argsrb  s  sx     &)U###7}}  U33(@@ &MJ !''
3 8  r[   c                 L    [        [        R                  S U  5       5      5      $ )zDDe-duplicate the sequence of names while keeping the original order.c              3  6   #    U  H  o  H  o"v   M     M     g 7fr_   rS   )r   seqrF  s      r\   r   $deduplicate_names.<locals>.<genexpr>  s     Dtttts   )rB  r   r   )seqss    r\   deduplicate_namesrh    s     DtDDEEr[   c                  @   \ rS rSrSrSS jr        SS jrSS jrSS jrSS jr	        SS jr
SS	 jrSS
 jrSSSSS.               SS jjr\    SS j5       r\      S S j5       r\4     S!S jjr      S"S jr      S#S jrSrg)$r`   i  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                    Xl         UR                  U l        0 U l        [        5       U l        SU R                  R                  S5      0U l        UR                  R                  R                  U S5        g )Nr  rI  
funcmanage)	r]   r  r   r   _holderobjseengetini_nodeid_autousenamespluginmanagerregister)r   r]   s     r\   r   FixtureManager.__init__  se    %nn
 JL25% ""=1B
! 	$$--dLAr[   c                
   Ub'  [        USS5      (       d  [        X!R                  US9nOSnU R                  U5      nU R	                  U5      n[        XeU5      n[        U5      nU R                  UUUS9u  p[        XGX5      $ )aC  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.
rB  F)rF  r   rS   )
parentnoder   ignore_args)	r  r'   rF  _getusefixturesnames_getautousenamesrh  rb  getfixtureclosurer   )r   rj   rP  r   r   usefixturesnamesautousenamesr   direct_parametrize_argsr   r   s              r\   getfixtureinfoFixtureManager.getfixtureinfo  s    $ GD,$F$F&t))EHH44T:,,T2(R">t"D)-)?)?%/ *@ *
& x}VVr[   c                   U(       a  UR                  S5      (       a  [        U5      n [        UR                  R	                  U R
                  R                  5      5      nUS:X  a  Sn[        R                  [        R                  :w  a.  UR                  [        R                  [        R                  5      nOS nU R                  X5        g ! [         a    Sn N{f = f)Nzconftest.pyr  .)endswithr?   r   rl   rM  r  rN  rO  r  sepr   SEPreplaceparsefactories)r   pluginplugin_nameconftestpathrh   s        r\   pytest_plugin_registered'FixtureManager.pytest_plugin_registered  s    
 ;//>>
 (4L\00<<T[[=Q=QRS }vv"		:FF+  s   8C CCc              #     #    UR                  5        H;  nU R                  R                  UR                  5      nU(       d  M1  U Sh  vN   M=     g N	7f)z8Return the names of autouse fixtures applicable to node.N)	listchainrn  r   rh   )r   rj   rs  	basenamess       r\   rv  FixtureManager._getautousenames  sE     ..*J1155j6G6GHIy$$$ + %s   >AA	A

Ac              #  d   #    UR                  SS9 H  nUR                   Sh  vN   M     g N	7f)z<Return the names of usefixtures fixtures applicable to node.rI  r  N)r^  r%  )r   rj   marks      r\   ru  #FixtureManager._getusefixturesnames  s-     %%=%9Dyy   : s   "0.
0c                z  ^
 [        U5      n0 m
SnU[        U5      :w  a  [        U5      nU H_  nXc;   a  M
  UT
;   a  M  U R                  Xa5      nU(       d  M,  UT
U'   US   R                   H  nX;  d  M
  UR	                  U5        M     Ma     U[        U5      :w  a  M  SU
4S jjn	UR                  U	SS9  UT
4$ )Nr   c                n   >  TU    nUS   R                   $ ! [         a    [        R                  s $ f = f)Nr   )rR   KeyErrorrC   rH   )arg_namer=  r   s     r\   sort_by_scope7FixtureManager.getfixtureclosure.<locals>.sort_by_scope!  s?    .-h7 #2---  &~~%&s    44T)r   r]  )r  r   r   rC   )r   r   r9  r   r  sort)r   rs  r   rt  fixturenames_closurelastlenr   r=  argr  r   s             @r\   rw   FixtureManager.getfixtureclosure  s      $L1@B122./G/)o-"11'F;/:OG,*277:077<  8 0 122	. 	!!mT!B#_44r[   c           
       ^^ SS jmUR                    H  mUR                  R                  T5      nU(       d  M'  [        UU4S jUR                  R                  S5       5       5      (       a  M]  [        U5       HW  nUR                  b4  UR                  TUR                  SUR                  UR                  S9    M  TUR                  ;  d  MV    M     M     g)zLGenerate new tests based on parametrized fixtures used by the given metafuncc                ^    [         R                  " U R                  0 U R                  D6u  pU$ r_   )r9   r_  r%  r  )r  r%  r   s      r\   get_parametrize_mark_argnamesKFixtureManager.pytest_generate_tests.<locals>.get_parametrize_mark_argnames/  s&    "::DIIUUGDKr[   c              3  :   >#    U  H  nTT" U5      ;   v   M     g 7fr_   rS   )r   r  r   r  s     r\   r   7FixtureManager.pytest_generate_tests.<locals>.<genexpr>=  s#      KD 8>>Ks   r\  NT)r]  rv   r  )r  r8   r   r  )r   r   r   any
definitionr^  r   r:  r\  rv   r  r   )r   metafuncr   rk   r   r  s       @@r\   pytest_generate_tests$FixtureManager.pytest_generate_tests,  s    	  ,,G#4488AL   $//<<]K    '|4
$$0(("))!%(..&NN )   *"5"55 5) -r[   c                     [        U5      US S & g r_   )r   )r   r   s     r\   pytest_collection_modifyitems,FixtureManager.pytest_collection_modifyitemsY  s     'ar[   r  NF)rv   r:  r  r.  c                  [        U R                  UUUUUUSS9nU R                  R                  U/ 5      n	UR                  (       a  U	R                  U5        O?[        U	 V
s/ s H  oR                  (       a  M  U
PM     sn
5      nU	R                  X5        U(       a5  U R                  R                  U=(       d    S/ 5      R                  U5        ggs  sn
f )aH  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  ri   r   rP  rv   r:  r  r   r  N)	r  r  r   
setdefaultr  r  r   insertrn  )r   rF  rP  rh   rv   r:  r  r.  fixture_defr  fr   s               r\   _register_fixture FixtureManager._register_fixture]  s    > !;;	
 ''224<##NN;' >1~~Q>?ANN1*%%002rBII$O  ?s   #C;Cc                    [        5       er_   r   )r   node_or_objs     r\   r  FixtureManager.parsefactories  s    
 "##r[   c                    [        5       er_   r   )r   r  rh   s      r\   r  r    r   r[   c                   U[         La  UnOh[        U[        R                  5      (       d   e[	        [
        UR                  5      n[        UR                  [        5      (       d   eUR                  nX0R                  ;   a  g[        U5      (       d+  [        U[        R                  5      (       d  [        U5      nOUnU R                  R                  U5        [        U5       H  n[!        XES5      n[#        U5      n[        U[$        5      (       d  M1  ['        X55      nUR(                  (       a  UR(                  n[+        X5      n	U R-                  UUU	UR.                  UR0                  UR2                  UR4                  S9  M     g)a(  Collect 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)rF  rh   rP  rv   r:  r  r.  )r+   rg   r   Noder
   r  r|   rh   r   rl  r.   types
ModuleTyperG  r   dirr-   r}   r{   r  rF  r&   r  rv   r:  r  r.  )
r   r  rh   	holderobjholderobj_tprF  obj_ubr#  r|   rP  s
             r\   r  r    sE   & #Ik5::6666V[__5Ik00#6666 ''F+++ I&&z)UEUEU/V/V#'	?L$L	*	ND ",d;F%f-Ff&;<<  )*C{{{{ #32D""ll}}JJ # - #r[   c                v     U R                   U   n[        U R                  X25      5      $ ! [         a     gf = f)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  rB  r  )r   r   rj   r=  s       r\   r9  FixtureManager.getfixturedefs  sC    	//8K T))+<==  		s   + 
88c              #     #    UR                  5        Vs1 s H  o3R                  iM     nnU H  nUR                  U;   d  M  Uv   M     g s  snf 7fr_   )rf   rh   ri   )r   r=  rj   nparentnodeidsrk   s         r\   r  FixtureManager._matchfactories  sL      ,0+<+<+>?+>a+>?%J  M1   & @s   AAAA)r   rl  rn  r  r]   r]   r7   r   r   )rj   
nodes.ItemrP  zCallable[..., object] | Noner   r   r   r   )r  r/   r  r   r   r   )rj   
nodes.Noder   Iterator[str])rj   r  r   r  )rs  r  r   r   rt  zAbstractSet[str]r   z6tuple[list[str], dict[str, Sequence[FixtureDef[Any]]]])r  rI   r   r   )r   list[nodes.Item]r   r   )rF  r   rP  z_FixtureFunc[object]rh   ra  rv   z8Scope | _ScopeName | Callable[[str, Config], _ScopeName]r:  r  r  r  r.  rb  r   r   )r  r  r   r   )r  r  rh   ra  r   r   )r  znodes.Node | objectrh   zstr | NotSetType | Noner   r   )r   r   rj   r  r   z Sequence[FixtureDef[Any]] | None)r=  zIterable[FixtureDef[Any]]rj   r  r   zIterator[FixtureDef[Any]])rU   rV   rW   rX   r   r   r{  r  rv  ru  rw  r  r  r  r   r  r+   r9  r  rZ   rS   r[   r\   r`   r`     s   <B"W"W +"W 	"W
 
"WH,0%!
(5(5 &(5 &	(5
 
@(5T)Z( KU*.QU5P 5P #	5P
 5P H5P (5P O5P 5P 
5Pn $$ 
$ $ $$ $ 
	$ $ +1B(B (B 
	BH>>",>	)>(!4!<F!	"!r[   r`   c                (    SSK Jn  U" U [        5      $ Nr   )wrap_session)_pytest.mainr  _show_fixtures_per_testr  r  s     r\   rQ  rQ    s    ) 788r[   c                    [        [        X5      5      n[        SS5      n [        X2R                  [        5      -  5      $ ! [
         a    [        X5      s $ f = f)Nz...rw   )r   r)   r   rM  _PYTEST_DIRrO  r@   )invocation_dirrP  locprefixs       r\   _pretty_fixture_pathr    sS    
{40
1C%#F06OOK8899 0>//0s   A AAc                &  ^^^^^	 SS K nUR                  5         U R                  R                  mUR                  R                  U 5      mU R                  5       mSU4S jjmSUUU4S jjm	SUUU	4S jjnUR                   H  nU" U5        M     g )Nr   c                F   > [        U T5      n[        T[        U5      5      $ r_   )r)   r@   r   )rP  r  r  s     r\   get_best_relpath1_show_fixtures_per_test.<locals>.get_best_relpath  s     $/>4955r[   c                  > U R                   nTS::  a  UR                  S5      (       a  g [        TU R                  5      nTR	                  U SS9  TR	                  SU 3SS9  TR	                  S5        [
        R                  " U R                  5      nU(       a&  [        TTS::  a  UR                  SS	S
9S   OU5        g TR                  SSS9  g )Nr   r   Tgreen -- yellowr  

r7  maxsplit    no docstring availabler  )
r   r  r  rP  writerH  getdocwrite_docstringr  r  )r  r   
prettypathfixture_docr  r  verboses       r\   write_fixture._show_fixtures_per_test.<locals>.write_fixture"  s    %%a<G..s33).+:J:JK

G9T*
4
|$T2
nn[%5%56a< !!&1!5a8 	 GG0dG;r[   c                ~  > [        U SS 5      nUb  UR                  (       d  g TR                  5         TR                  SSU R                   35        TR                  SST" U R
                  5       S35        [        UR                  R                  5       5       H  u  p#Uc   eU(       d  M  T" US   5        M      g )Nrp  -zfixtures used by ()r   )r  r   r  r  rF  r  r   r   )r   infor   r=  r  r  r  s       r\   
write_item+_show_fixtures_per_test.<locals>.write_item5  s    '.t^T'J<t44
	
s'		{34
sa(78:;$T%:%:%@%@%BCNA***+b/* Dr[   r  )r  rh  r   r   )r   r  r   r   )_pytest.configperform_collectinvocation_paramsr  r  create_terminal_writerget_verbosityr   )
r  r]   rw   r  session_itemr  r  r  r  r  s
        @@@@@r\   r  r    sv    --11N		.	.v	6B""$G6< <&+ +$  <  &r[   c                (    SSK Jn  U" U [        5      $ r  )r  r  _showfixtures_mainr  s     r\   rN  rN  K  s    ) 233r[   c           
     4   SS K nUR                  5         U R                  R                  nUR                  R                  U 5      nU R                  5       nUR                  n/ n[        5       nUR                  R                  5        H  u  pU
c   eU
(       d  M  U
 H  n[        UR                  U5      nUR                  U4U;   a  M-  UR                  UR                  U45        UR                  [!        UR"                  5      UR                  R$                  ['        X;R                  5      UR                  U45        M     M     UR)                  5         S nU GH7  u  pnpX:w  a=  UR+                  S5      (       d'  UR-                  5         UR/                  SSU 35        UnUS::  a  U	R+                  S5      (       a  Mh  UR1                  U	 SS9  UR2                  S:w  a  UR1                  S	UR2                   S
3SS9  UR1                  SU 3SS9  UR1                  S5        [4        R6                  " UR                  5      nU(       a%  [9        XES::  a  UR;                  SSS9S   OU5        OUR-                  SSS9  UR-                  5         GM:     g )Nr   z_pytest.r  zfixtures defined from r   Tr  r  z [z scope])cyanr  r  r  r  r7  r  r  r  )r  r  r  r  r  r  r  ra   r   r   r   r)   rP  r   r   r  r   ri   rV   r  r  r  r  r  r  rv   rH  r  r  r  )r  r]   rw   r  r  r  r  r  seenr   r=  rk   r  currentmoduleri   r  r  docs                     r\   r  r  Q  sF   --11N		.	.v	6B""$G		 	 BI!$D " 3 3 9 9 ;&&&%Jjoo~>C""C(D0HHj((#./
))*OO..(I&& &	 !<& NNM;D7
G"$$Z00	s4VH=> &a<G..s33
G9T*z)HHr***+73$H?
4
|$T2
nnZ__-1CIIfqI1!4# GG0dG;
	) <Er[   c                Z    UR                  S5       H  nU R                  X#-   5        M     g )Nr  )r  r  )r  r  r  r  s       r\   r  r    s"    		$
  r[   r  )rj   r  rk   rh  r   nodes.Node | None)rj   r  rv   rC   r   r  )r|   r  r   zFixtureFunctionMarker | None)r   r  rv   rC   r   zIterator[FixtureArgKey])r   zSequence[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]]]rv   rC   r   r  )r  r  r6  r   r   rJ   r   )r  z#Callable[[str, Config], _ScopeName]r  r   r  r0   r   rA   )rk   FixtureDef[FixtureValue]r6  r   r   r  )rk   r   r6  r0  r   rJ   )r  rK   r*  r{   r   rK   )r>  rK   rv   r-  r:  Iterable[object] | Noner.  rb  r  ?Sequence[object | None] | Callable[[Any], object | None] | NonerF  ra  r   rK   ).)r>  r   rv   r-  r:  r  r.  rb  r  r  rF  ra  r   r{   r_   )r>  zFixtureFunction | Nonerv   r-  r:  r  r.  rb  r  r  rF  ra  r   z'FixtureFunctionMarker | FixtureFunction)r6  r   r   r0   )rU  r2   r   r   )r  r0   r   zint | ExitCode | None)rj   r  r   zset[str])rg  zIterable[str]r   r   )r  r0   r   zint | ExitCode)r  r   r   r   )r  r0   r]   r7   r   r   )z    )r  r"   r  r   r  r   r   r   )
__future__r   rj  collectionsr   r   dataclassesr  rH  r  pathlibr   sysr  typingr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r7  rw   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/   r0   r1   _pytest.config.argparsingr2   _pytest.deprecatedr4   r5   r6   r  r7   _pytest.markr8   r9   _pytest.mark.structuresr:   _pytest.outcomesr<   r=   r>   _pytest.pathlibr?   r@   _pytest.scoperA   rB   rC   version_infoexceptiongrouprF   re   rG   rH   rI   rJ   r  rK   _FixtureFuncr  TracebackType_FixtureCachedResult	dataclassrO   rb   rm   rx   r}   r   r   
OrderedSetr   r   r   r   ABCr   rm  r0  LookupErrorr'  r  r  r  r  r  r  r
  r+  r{   r?  rD  rG  rW  rZ  rb  rh  r`   rQ  __file__rl   r  r  r  rN  r  r  rS   r[   r\   <module>r     s   " 
 #     	  
              !              %   / + & ) ' ( * * $ & ' ! % ' ' ( ! # , - - ,    % 1 ! ! ) ( ' $ %  g1 ('' ~&+8CK3HIS,#ytT9Q/R*R!SS 		 
mXe&9&9::;		= $ d#w|,  $
6	
	"	 	& d#  $ T]"d(^
N
N"NNB.6!6S66 6 6r d#7N 7N $7NtoSWW od	 &* &* &*R S1 S1 S1l 6R 6R 6RrL\ 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!p9 7##$++02!j46rr[   