
    ?gS              
         S r 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
J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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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,J0r0  SS K,J1r1  SS!K,J2r2  SS"K,J3r3  SS#K,J4r4  SS$K,J5r5  SS%K,J6r6  SS&K7J8r8  SS'K7J9r9  SS(K:J;r;  SS)K<J=r=  SS*K>J?r?  SS+K>J@r@  SS,K>JArA  SS-K>JBrB  SS.KCJDrD  SS/KEJFrF  SS0KEJGrG  SS1KHJIrI  SS2KHJJrJ  SS3KHJKrK  SS4KHJLrL  SS5KMJNrN  SS6KMJOrO  SS7KPJQrQ  SS8KPJRrR  SS9KPJSrS  SS:KPJTrT  SS;KUJVrV  SS<KUJWrW  SS=KXJYrY  SS>KZJ[r[  SS?KZJ\r\  SS@KZJ]r]  \(       a  SSAK^J_r_  SoSB jr`SpSD jraSqSE jrbSrSF jrc\9" SGSH9SsSJ j5       rd      StSK jreSuSL jrfSvSM jrgSwSO jrh\9" SGSH9        SxSP j5       ri " SQ SR\"R                  5      rk " SS ST5      rl\mR                  \m" 5       \o" \R                  " SU5      5      1 SVk\o" \l5      \o" \l" 5       5      5      rqCl " SW SX\k\"R                  \R                  5      rt    SySY jru " SZ SN\"R                  \t5      rw " S[ S\\"R                  5      rySzS] jrzS{S^ jr{ " S_ S`\t5      r|S|Sa jr}S|Sb jr~\\R                  " SGSc9 " Sd Se5      5       5       r\\R                  " SGSc9 " Sf Sg5      5       5       rS}Sh jr\Y\\\?\   4      " 5       r\ " Si SC5      5       r        S~Sj jrSSk jr " Sl SI\k\"GR                  5      r " Sm Sn\5      rg)z7Python test discovery, setup and run of test functions.    )annotationsN)Counter)defaultdict)partial)Path)Any)Callable)Dict)final)	Generator)Iterable)Iterator)Literal)Mapping)Pattern)Sequence)TYPE_CHECKING)fixtures)nodes)filter_traceback)getfslineno)ExceptionInfo)TerminalRepr)	Traceback)saferepr)ascii_escaped)get_default_arg_names)get_real_func)	getimfunc)is_async_function)is_generator)LEGACY_PATH)NOTSETsafe_getattr)safe_isclass)Config)hookimpl)Parser)check_ispytest)
FixtureDef)FixtureRequest)FuncFixtureInfo)get_scope_node)Session)MARK_GEN)ParameterSet)get_unpacked_marks)Mark)MarkDecorator)normalize_mark_list)fail)skip
fnmatch_ex)import_path)ImportPathMismatchError)scandir)
_ScopeName)Scope)StashKey)PytestCollectionWarning)PytestReturnNotNoneWarning)PytestUnhandledCoroutineWarning)Selfc                    U R                  SSSS/SS9  U R                  SSS/S	S9  U R                  S
SS/SS9  U R                  SSSSS9  g )Npython_filesargsz	test_*.pyz	*_test.pyz9Glob-style file patterns for Python test module discovery)typedefaulthelppython_classesTestz6Prefixes or glob names for Python test class discoverypython_functionstestzDPrefixes or glob names for Python test function and method discoveryDdisable_test_id_escaping_and_forfeit_all_rights_to_community_supportboolFzcDisable string escape non-ASCII characters, might cause unwanted side effects(use at your own risk))addini)parsers    0/usr/lib/python3/dist-packages/_pytest/python.pypytest_addoptionrS   T   s    
MMk*H   MME	   MMS	   MMN-	      Metafuncc                    U R                   R                  SS9 H-  nU R                  " UR                  0 UR                  DSU0D6  M/     g )Nparametrizename_param_mark)
definitioniter_markersrW   rF   kwargs)metafuncmarkers     rR   pytest_generate_testsr`   q   sA    %%222FfkkOV]]OO GrT   c                L    U R                  SS5        U R                  SS5        g )Nmarkersa  parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see https://docs.pytest.org/en/stable/how-to/parametrize.html for more info and examples.zusefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/stable/explanation/fixtures.html#usefixtures )addinivalue_line)configs    rR   pytest_configurere   v   s1    
	
 	SrT   c                    SnUS-  nUS-  nUS-  nUS-  nUS-  nUS-  n[         R                  " [        UR                  U 5      5      5        [	        SS	9  g )
NzFasync def functions are not natively supported and have been skipped.
zMYou need to install a suitable plugin for your async framework, for example:
z
  - anyio
z  - pytest-asyncio
z  - pytest-tornasync
z  - pytest-trio
z  - pytest-twistedz?async def function and no async plugin installed (see warnings))reason)warningswarnrB   formatr7   )nodeidmsgs     rR   async_warn_and_skiprm      sp    
SCXC =C!!C##CCCMM1#**V2DEFQRrT   T)trylastFunctionc           	        U R                   n[        U5      (       a  [        U R                  5        U R                  nU R
                  R                   Vs0 s H  o3X#   _M	     nnU" S0 UD6n[        US5      (       d  [        US5      (       a  [        U R                  5        gUb1  [        R                  " [        SU R                   SU< S35      5        gs  snf )N	__await__	__aiter__zExpected None, but z
 returned zj, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?T )objr    rm   rk   funcargs_fixtureinfoargnameshasattrrh   ri   rA   )
pyfuncitemtestfunctionru   argtestargsresults         rR   pytest_pyfunc_callr~      s    >>L&&J--.""H.8.E.E.N.NO.NsX]".NHO%H%Fv{##wv{'C'CJ--.  
	&%j&7&7%8
6* M_ _	
  Ps   Cc                    U S-  n UR                  5       nU(       a  [        R                  XS9$ g ! [         a     g f = f)N__init__.pypath)is_filePermissionErrorPackagefrom_parent)r   parentpkginithas_pkginits       rR   pytest_collect_directoryr      sO     ]"Goo' ""6"55  s   2 
??c                   U R                   S:X  av  UR                  R                  U 5      (       d*  [        XR                  R                  S5      5      (       d  g UR                  R                  U 5      nUR                  XS9nU$ g )Nz.pyrE   module_pathr   )suffixsession
isinitpathpath_matches_patternsrd   getinigethookproxypytest_pycollect_makemodule)	file_pathr   ihookmodules       rR   pytest_collect_filer      s    5 ~~((33(==//?  ++I6::! ; 
 rT   c                .   ^  [        U 4S jU 5       5      $ )zKReturn whether path matches any of the patterns in the list of globs given.c              3  <   >#    U  H  n[        UT5      v   M     g 7fNr8   ).0patternr   s     rR   	<genexpr>(path_matches_patterns.<locals>.<genexpr>   s     AWz'4((s   )any)r   patternss   ` rR   r   r      s    AAAArT   Modulec                (    [         R                  XS9$ )Nr   )r   r   r   s     rR   r   r      s    f77rT   c                @   [        U [        [        45      (       d   [        U 5      5       e[	        U5      (       a,  U R                  X!5      (       a  [        R                  XUS9$  g U R                  X!5      (       Ga   [        USU5      n[        R                  " U5      (       dc  [        R                  " [        U5      5      (       d?  [        U5      u  p4[        R                  " [        SU< S35      S [!        U5      US-   S9  g [        USS5      (       a  [#        U5      (       aY  [$        R                  XS	9nS
U S3nUR'                  [(        R*                  " SUS95        UR-                  [        U5      5        U$ [/        U R1                  X5      5      $ g )N)rY   rt   __func__zcannot collect z because it is not a function.   )messagecategoryfilenamelineno__test__TrX   z)yield tests were removed in pytest 4.0 - z will be ignoredF)runrg   )
isinstanceClassr   rG   r&   istestclassr   istestfunctiongetattrinspect
isfunctionr   r   rh   warn_explicitr@   strr!   ro   
add_markerr0   xfailri   list_genfunctions)	collectorrY   rt   r   r   resrg   s          rR   pytest_pycollect_makeitemr      s{    i%11B4	?B1C  ++$$Ys$CC ,: 7 
	!	!#	,	,c:s+ ""3''7+=+=mC>P+Q+Q*3/H""/%dX-KL Xz&  S*d++C  **9*@?vEUV  x~~%GH089
I33D>??rT   c                      \ rS rSrSrSr\S 5       r\S 5       r\S 5       r	\S 5       r
\
R                  S 5       r
S	 rSSS
 jjrSS jrSrg)
PyobjMixin   zthis mix-in inherits from Node to carry over the typing information

as its intended to always mix in before a node
its position in the mro is unaffectedTc                N    U R                  [        5      nUb  UR                  $ S$ )z@Python module object this node was collected from (can be None).N)	getparentr   rt   selfnodes     rR   r   PyobjMixin.module  s&     ~~f%+txx55rT   c                N    U R                  [        5      nUb  UR                  $ S$ )z?Python class object this node was collected from (can be None).N)r   r   rt   r   s     rR   clsPyobjMixin.cls  s&     ~~e$+txx55rT   c                    g)zPython instance object the function is bound to.

Returns None if not a test method, e.g. for a standalone test function,
a class or a module.
Nrs   r   s    rR   instancePyobjMixin.instance  s     rT   c                *   [        U SS5      nUc  U R                  5       =U l        nU R                  (       aZ  U R                  R                  [        U R                  5      5        U R                  R                  S U R                   5       5        U$ )zUnderlying Python object._objNc              3  <   #    U  H  oR                   U4v   M     g 7fr   rX   r   marks     rR   r   !PyobjMixin.obj.<locals>.<genexpr>#  s     $TCS4ii%6CS   )
r   _getobjr   _ALLOW_MARKERSown_markersextendr2   rt   keywordsupdater   rt   s     rR   rt   PyobjMixin.obj  sw     dFD);"lln,DI ""  ''(:488(DE $$$T4CSCS$TT
rT   c                    Xl         g r   r   )r   values     rR   rt   r   &  s    	rT   c                v    U R                   c   eU R                   R                  n[        XR                  5      $ )zCGet the underlying Python object. May be overwritten by subclasses.)r   rt   r   rY   r   s     rR   r   PyobjMixin._getobj*  s0     {{&&&kkoosII&&rT   c                `   / nU R                  5        Hx  nUR                  n[        U[        5      (       aC  [        R
                  R                  U5      S   nU(       a  U(       a  UR                  U5          OUR                  U5        Mz     UR                  5         SR                  U5      $ )z5Return Python path relative to the containing module.r   .)
iter_parentsrY   r   r   osr   splitextappendreversejoin)r   stopatmoduleincludemodulepartsr   rY   s         rR   
getmodpathPyobjMixin.getmodpath1  s    %%'D99D$''ww''-a0$T*LL ( 	xxrT   c                X    [        U R                  5      u  pU R                  5       nXU4$ r   )r   rt   r   )r   r   r   modpaths       rR   
reportinfoPyobjMixin.reportinfo@  s)    "488,//#W$$rT   r   N)TF)r   rO   r   rO   returnr   )r   z.tuple[os.PathLike[str] | str, int | None, str])__name__
__module____qualname____firstlineno____doc__r   propertyr   r   r   rt   setterr   r   r   __static_attributes__rs   rT   rR   r   r      s    -
 N6 6
 6 6
     	ZZ '%rT   r   c                      \ rS rSrSrg)_EmptyClassiK  rs   N)r   r   r   r   r   rs   rT   rR   r   r   K  s    4rT   r   empty_module>   __file__
__cached____builtins__c                  d    \ 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
rg)PyCollectori[  c                &    U R                  SU5      $ )NrL   _matches_prefix_or_glob_optionr   rY   s     rR   funcnamefilterPyCollector.funcnamefilter\  s    223EtLLrT   c                     [        USS5      SL $ )zWLook for the __test__ attribute, which is applied by the
@nose.tools.istest decorator.
r   FTr$   r   s     rR   
isnosetestPyCollector.isnosetest_  s     CU3t;;rT   c                &    U R                  SU5      $ )NrJ   r  r  s     rR   classnamefilterPyCollector.classnamefilterh  s    223CTJJrT   c                    U R                  U5      (       d  U R                  U5      (       aR  [        U[        [        45      (       a  [        USS5      n[        U5      =(       a    [        R                  " U5      S L $ g)Nr   F)	r  r
  r   staticmethodclassmethodr%   callabler   getfixturemarkerr   rt   rY   s      rR   r   PyCollector.istestfunctionk  sc    t$$(<(<#k:;;"3
E:C=KX%>%>s%Ct%KKrT   c                    U R                  U5      (       d  U R                  U5      (       d  g[        R                  " U5      (       a  gg)NFT)r  r
  r   
isabstractr  s      rR   r   PyCollector.istestclasst  s;    $$T**dooc.B.Bc""rT   c                    U R                   R                  U5       HL  nUR                  U5      (       a    gSU;   d  SU;   d  SU;   d  M/  [        R                  " X#5      (       d  ML    g   g)zXCheck if the given name matches the prefix or glob-pattern defined
in ini configuration.T*?[F)rd   r   
startswithfnmatch)r   option_namerY   options       rR   r  *PyCollector._matches_prefix_or_glob_option{  sc     kk((5Fv&& -3&=C6MwH H  6 rT   c                   [        U R                  SS5      (       d  / $ [        U R                  S0 5      /n[        U R                  [        5      (       a8  U R                  R                   H  nUR                  UR                  5        M      [        5       n/ nU R                  nU H  n/ n[        UR                  5       5       Hw  u  pU[        ;   a  M  X;   a  M  UR                  U5        UR                  XU	S9n
U
c  M>  [        U
[        5      (       a  UR                  U
5        Mf  UR                  U
5        My     UR                  U5        M     / n[        U5       H  nUR                  U5        M     U$ )Nr   T__dict__)r   rY   rt   )r   rt   r   rG   __mro__r   r#  setr   r   itemsIGNORED_ATTRIBUTESaddr   r   reversed)r   dictsbaseclsseendict_valuesr   dicvaluesrY   rt   r   r}   s               rR   collectPyCollector.collect  sF   txxT22I :r23dhh%%88++W--. ,
 @B

C9;F "#))+.	--<55"3 6  ;T**MM#&MM#& / v&' . {+FMM&! ,rT   c           
   #  R  #    U R                  [        5      nUc   eUR                  nU R                  [        5      nU=(       a    UR                  =(       d    S n[        R                  XUS9nUR                  n[        UUU R                  UUSS9n	/ n
[        US5      (       a  U
R                  UR                  5        Ub1  [        US5      (       a   U
R                  U" 5       R                  5        U R                  R                  R                  U
[        U	S95        U	R                  (       d  [         R                  XUS9v   g UR#                  5         U	R                   H;  nU SUR$                   S3n[         R                  U UUUUR$                  S0US	9v   M=     g 7f)
N)rY   callobjT)r[   fixtureinford   r   r   	_ispytestr`   )r^   )rY   r4  r  ])rY   callspecr4  r   originalname)r   r   rt   r   FunctionDefinitionr   rv   rU   rd   rx   r   r`   r   
call_extradict_callsro   prune_dependency_treeid)r   rY   funcobj	modulecolr   clscolr   r[   r4  r^   methodsr7  subnames                rR   r   PyCollector._genfunctions  sy    NN6*	$$$&#+t'33DW3U
 -- !#;;
 6233NN6778?ws,CDDNN35667

((33GT8=TU&&tK&PP --/$OO!F!HKK=2** % +&kk40!% +   ,s   F%F'rs   N)rY   r   r   rO   rt   objectr   rO   )rt   rF  rY   r   r   rO   )r  r   rY   r   r   rO   r   z&Iterable[nodes.Item | nodes.Collector])rY   r   r   zIterator[Function])r   r   r   r   r  r
  r  r   r   r  r0  r   r   rs   rT   rR   r  r  [  s-    M<K)V.rT   r  c                   UR                  S5      n [        U UUR                  UR                  S5      S9nUR0                  R3                  U5        U$ ! [         aE  n[
        R                  R                  [        R                  " 5       R                  SS95      UeS nAf[         a<  n[
        R                  R                  SR                  " UR                  6 5      UeS nAf[         a  n[        R                  " 5       nUR                  5       S:  a$  UR                   R#                  [$        5      Ul        UR                   (       a  UR                  SS9OUR'                  5       n[)        U5      n[
        R                  R                  SU  S	U 35      UeS nAf[*        R,                   a7  nUR.                  (       a  e [
        R                  R                  S
5      UeS nAff = f)Nz--import-modeconsider_namespace_packages)moderootrI  shortstylezimport file mismatch:
imported module {!r} has this __file__ attribute:
  {}
which is not the same as the test file we want to collect:
  {}
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules   z)ImportError while importing test module 'zR'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
zUsing pytest.skip outside of a test will skip the entire module. If that's your intention, pass `allow_module_level=True`. If you want to skip a specific test or an entire class, use the @pytest.mark.skip or @pytest.mark.skipif decorators.)	getoptionr:   rootpathr   SyntaxErrorr   	CollectorCollectErrorr   from_currentgetreprr;   rj   rF   ImportErrorget_verbosity	tracebackfilterr   exconlyr   r7   	Exceptionallow_module_levelpluginmanagerconsider_module)r   rd   
importmodemodeexc_infoexc_reprformatted_tbs           rR   importtestmodulerf    s   
 !!/2J-(.6S(T	
Z ((-JQ  oo**&&(00w0?
	 # 	oo**9 :@@ BCI
 	   --/!A%!)!3!3!:!:;K!LH !! 7+!!# 	
 8}oo**7v > n

 	 >> oo**K

 	s=   %A 
G,A BG,,7C##G,0B.FG,52G''G,c                  J   ^  \ rS rSrSrS rSU 4S jjrS	S jrS	S jrSr	U =r
$ )
r   i  z<Collector for test classes and functions in a Python module.c                B    [        U R                  U R                  5      $ r   )rf  r   rd   r   s    rR   r   Module._getobj!  s    		4;;77rT   c                   > U R                  5         U R                  5         U R                  R                  R	                  U 5        [
        TU ]  5       $ r   )_register_setup_module_fixture _register_setup_function_fixturer   _fixturemanagerparsefactoriessuperr0  r   	__class__s    rR   r0  Module.collect$  s@    ++---/$$33D9w  rT   c                  ^^ [        U R                  S5      m[        U R                  S5      mTc  Tc  gS	UU4S jjnU R                  R                  R	                  SU R                  R
                   3UU R                  SSS9  g)
a  Register an autouse, module-scoped fixture for the collected module object
that invokes setUpModule/tearDownModule if either or both are available.

Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
other fixtures (#517).
setUpModulesetup_moduletearDownModuleteardown_moduleNc              3  l   >#    U R                   nTb  [        TU5        S v   Tb  [        TU5        g g 7fr   )r   _call_with_optional_argument)requestr   rv  ry  s     rR   xunit_setup_module_fixtureIModule._register_setup_module_fixture.<locals>.xunit_setup_module_fixture;  s7     ^^F',\6B*,_fE +s   14_xunit_setup_module_fixture_r   TrY   funcrk   scopeautouser   zGenerator[None]_get_first_non_fixture_funcrt   r   rm  _register_fixturer   rk   )r   r}  rv  ry  s     @@rR   rk  %Module._register_setup_module_fixture*  s     3HH5
 6HH;
 O$;	F 	F 	$$66/0A0A/BC+;; 	7 	
rT   c                  ^^ [        U R                  S5      m[        U R                  S5      mTc  Tc  gS	UU4S jjnU R                  R                  R	                  SU R                  R
                   3UU R                  SSS9  g)
a
  Register an autouse, function-scoped fixture for the collected module object
that invokes setup_function/teardown_function if either or both are available.

Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
other fixtures (#517).
)setup_function)teardown_functionNc              3     >#    U R                   b  S v   g U R                  nTb  [        TU5        S v   Tb  [        TU5        g g 7fr   )r   functionr{  )r|  r  r  r  s     rR   xunit_setup_function_fixtureMModule._register_setup_function_fixture.<locals>.xunit_setup_function_fixtureZ  sN     + ''H),^XF ,,->I -s   AA_xunit_setup_function_fixture_r  Tr  r  r  )r   r  r  r  s     @@rR   rl  'Module._register_setup_function_fixtureL  s     5TXX?RS7HH,
 !&7&?	J 	J 	$$661$((2C2C1DE-;; 	7 	
rT   rs   rG  r   None)r   r   r   r   r   r   r0  rk  rl  r   __classcell__rq  s   @rR   r   r     s     F8! 
D"
 "
rT   c                  ^   ^  \ rS rSrSr    S       SU 4S jjjrS	S jrS
S jrSrU =r	$ )r   iq  a\  Collector for files and directories in a Python packages -- directories
with an `__init__.py` file.

.. note::

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

.. versionchanged:: 8.0

    Now inherits from :class:`~pytest.Directory`.
c           	     B   > UR                   n[        TU ]	  UUUUUUS9  g )N)fspathr   r   rd   r   rk   )r   ro  __init__)r   r  r   rd   r   rk   r   rq  s          rR   r  Package.__init__  s2     .. 	 	
rT   c                    [        U R                  S-  U R                  5      n[        US5      nUb  [	        X!5        [        US5      nUb"  [        [        X15      nU R                  U5        g g )Nr   rt  rw  )rf  r   rd   r  r{  r   addfinalizer)r   init_modrv  ry  r  s        rR   setupPackage.setup  su    #DII$=t{{K 35
 #(@5;
 &7SDd# 'rT   c              #  l  #    SS jnU R                   nU R                  n[        U R                  U5       H  nUR	                  5       (       ad  [        UR                  5      nU R                  R                  USS9(       d  UR                  XRS9(       a  Mb  UR                  XPS9nUb  Uv   Mz  M|  UR                  5       (       d  M  [        UR                  5      nU R                  R                  U5      (       d  UR                  XRS9(       a  M  UR                  XPS9nU S h  vN   M     g  N	7f)Nc                8    U R                   S:g  U R                   4$ )Nr   rX   )entrys    rR   sort_key!Package.collect.<locals>.sort_key  s    JJ-/<<rT   T)with_parents)collection_pathrd   )r   r   )r   r   )r  zos.DirEntry[str]r   rF  )rd   r   r<   r   is_dirr   r   r   pytest_ignore_collectr   r   r   )r   r  rd   r   direntryr   colcolss           rR   r0  Package.collect  s    	=  

		84H  HMM*||..t$.G2242W 44$4L?I # !!##HMM*||..t442242W 0040M! 5   s   CD4	AD4(D2)
D4rs   )NNNN)r  zLEGACY_PATH | Noner   nodes.Collectorr   zPath | Noner   r  r  rG  )
r   r   r   r   r   r  r  r0  r   r  r  s   @rR   r   r   q  sU    &  
"
  
 
 

 
,$$   rT   r   c                    U R                   R                  n[        R                  " U 5      (       a  US-  nU(       a	  U " U5        gU " 5         g)zuCall the given function with the given argument if func accepts one argument, otherwise
calls func without arguments.r   N)__code__co_argcountr   ismethod)r  r{   	arg_counts      rR   r{  r{    s<     ))IQ	S	rT   c                n    U H/  n[        XS5      nUc  M  [        R                  " U5      b  M-  Us  $    g)zReturn the attribute from the given object to be used as a setup/teardown
xunit-style function, but only if not marked as a fixture to avoid calling it twice.
N)r   r   r  )rt   namesrY   meths       rR   r  r    s:     %c6 9 9$ ? GK  rT   c                  l   ^  \ rS rSrSr\SS.SU 4S jjj5       rS rSU 4S jjrSS jr	SS	 jr
S
rU =r$ )r   i  zBCollector for test methods (and nested classes) in a Python class.Nrt   c               (   > [         TU ]  " SX!S.UD6$ )The public constructor.)rY   r   rs   ro  r   )r   r   rY   rt   kwrq  s        rR   r   Class.from_parent  s     w"BBrBBrT   c                "    U R                  5       $ r   r  r   s    rR   newinstanceClass.newinstance  s    xxzrT   c           	       > [        U R                  SS5      (       d  / $ [        U R                  5      (       a[  U R                  c   eU R	                  [        SU R                  R                  < SU R                  R                   S35      5        / $ [        U R                  5      (       a[  U R                  c   eU R	                  [        SU R                  R                  < SU R                  R                   S35      5        / $ U R                  5         U R                  5         U R                  R                  R                  U R                  5       U R                  5        [        TU ]A  5       $ )Nr   Tzcannot collect test class z. because it has a __init__ constructor (from: )z- because it has a __new__ constructor (from: )r%   rt   hasinitr   ri   r@   r   rk   hasnew_register_setup_class_fixture_register_setup_method_fixturer   rm  rn  r  ro  r0  rp  s    rR   r0  Class.collect  s;   DHHj$77I488;;***II'01B1B0E F337;;3E3E2FaI IDHH;;***II'01B1B0E F226++2D2D1EQH I**,++-$$33D4D4D4FTw  rT   c                  ^^ [        U R                  S5      m[        U R                  S5      mTc  Tc  gS	UU4S jjnU R                  R                  R	                  SU R                  R
                   3UU R                  SSS9  g)
a  Register an autouse, class scoped fixture into the collected class object
that invokes setup_class/teardown_class if either or both are available.

Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
other fixtures (#517).
)setup_class)teardown_classNc              3     >#    U R                   nTb  [        T5      n[        X!5        S v   Tb  [        T5      n[        X!5        g g 7fr   )r   r   r{  )r|  r   r  r  r  s      rR   xunit_setup_class_fixtureFClass._register_setup_class_fixture.<locals>.xunit_setup_class_fixture  sG     ++C& -,T7) 0,T7 *s   AA_xunit_setup_class_fixture_classTr  r  r  rt   r   rm  r  r   rk   )r   r  r  r  s     @@rR   r  #Class._register_setup_class_fixture  s     2$((<LM4TXX?RS>#9	8 	8 	$$66.txx/D/D.EF*;; 	7 	
rT   c                $  ^^^^ Sm[        U R                  T45      mSm[        U R                  T45      mTc  Tc  gS	UUUU4S jjnU R                  R                  R	                  SU R                  R
                   3UU R                  SSS9  g)
a  Register an autouse, function scoped fixture into the collected class object
that invokes setup_method/teardown_method if either or both are available.

Using a fixture to invoke these methods ensures we play nicely and unsurprisingly with
other fixtures (#517).
setup_methodteardown_methodNc              3     >#    U R                   nU R                  nTb  [        UT5      n[        X25        S v   Tb  [        UT5      n[        X25        g g 7fr   )r   r  r   r{  )r|  r   methodr  r  
setup_namer  teardown_names       rR   xunit_setup_method_fixtureHClass._register_setup_method_fixture.<locals>.xunit_setup_method_fixture0  sX     ''H%%F'x4,T:*x7,T: +s   AA_xunit_setup_method_fixture_r  Tr  r  r  )r   r  r  r  r  r  s     @@@@rR   r  $Class._register_setup_method_fixture"  s     $
2488j]K)5dhh@PQO$;		; 		; 	$$66/0E0E/FG+;; 	7 	
rT   rs   r   rC   rG  r  )r   r   r   r   r   r  r   r  r0  r  r  r   r  r  s   @rR   r   r     s<    L.2 C C C!:
> 
  
rT   r   c                R    [        U SS 5      nU(       a  U[        R                  :g  $ g)Nr  F)r   rF  r  )rt   inits     rR   r  r  E  s%    3
D1Dv&&rT   c                R    [        U SS 5      nU(       a  U[        R                  :g  $ g)N__new__F)r   rF  r  )rt   news     rR   r  r  L  s%    #y$/C
fnn$$rT   )frozenc                      \ rS rSr% SrSrS\S'   S\S'   S\S	'   S
\S'   S\S'   S\S'   S\S'   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5       rSrg)#IdMakeriS  zMake IDs for a parametrization.)rw   parametersetsidfnidsrd   rk   	func_nameSequence[str]rw   Sequence[ParameterSet]r  z%Callable[[Any], object | None] | Noner  zSequence[object | None] | Noner  Config | Nonerd   
str | Nonerk   r  c                (   [        U R                  5       5      n[        U5      [        [        U5      5      :w  a  [	        U5      n[        [        5      n[        U5       H  u  pEX%   S:  d  M  SnU(       a  US   R                  5       (       a  SnU U X5    3nU[        U5      ;   a'  X5==   S-  ss'   U U X5    3nU[        U5      ;   a  M'  XqU'   X5==   S-  ss'   M     [        U5      [        [        U5      5      :X  d   SU< 35       eU$ )a  Make a unique identifier for each ParameterSet, that may be used to
identify the parametrization in a node ID.

Format is <prm_1_token>-...-<prm_n_token>[counter], where prm_x_token is
- user-provided id, if given
- else an id derived from the value, applicable for certain types
- else <argname><parameterset index>
The counter suffix is appended only in case a string wouldn't be unique
otherwise.
r    _zInternal error: resolved_ids=)	r   _resolve_idslenr%  r   r   int	enumerateisdigit)r   resolved_ids	id_countsid_suffixesindexr>  r   new_ids           rR   make_unique_parameterset_ids$IdMaker.make_unique_parameterset_idsv  s!    D--/0|C$5 66-I*5c*:K&|4	=1$Fbfnn..!$ "tF8KO+<=F C$55#1,$&4x/@!A !C$55 +1'Oq(O 5 < C%
 
 	.+l_-	. 
 rT   c              #    ^ ^#    [        T R                  5       H  u  mnUR                  b  UR                  v   M#  T R                  (       aL  T[	        T R                  5      :  a3  T R                  T   b#  T R                  T R                  T   T5      v   M  SR                  UU 4S j[        UR                  T R                  5       5       5      v   M     g7f)z;Resolve IDs for all ParameterSets (may contain duplicates).N-c              3  L   >#    U  H  u  pTR                  XT5      v   M     g 7fr   )_idval)r   valargnameidxr   s      rR   r   'IdMaker._resolve_ids.<locals>.<genexpr>  s(      (O KKc22(Os   !$)
r  r  r>  r  r  _idval_from_value_requiredr   zipr/  rw   )r   parametersetr  s   ` @rR   r  IdMaker._resolve_ids  s     !*4+=+=!>C*"oo%cCM1dhhsm6O55dhhsmSII hh (+L,?,?(O   "?s   CCc                    U R                  XU5      nUb  U$ U R                  X5      nUb  U$ U R                  U5      nUb  U$ U R                  X#5      $ )z-Make an ID for a parameter in a ParameterSet.)_idval_from_function_idval_from_hook_idval_from_value_idval_from_argname)r   r  r  r  idvals        rR   r   IdMaker._idval  sf    ))#<L%%c3L&&s+L''55rT   c                   U R                   c  g U R                  U5      nUc  gU R                  U5      $ ! [         aD  nU R                  b  U R                   S3OSnSnXgR                  X#5      -   n[	        U5      UeSnAff = f)zbTry to make an ID for a parameter in a ParameterSet using the
user-provided id callable, if given.N: r  zJerror raised while trying to determine id of parameter '{}' at position {})r  r\  rk   rj   
ValueErrorr  )r   r  r  r  r>  rb  prefixrl   s           rR   r
  IdMaker._idval_from_function  s     99	)3B :%%b))  	)+/;;+B}B'F^C::g33CS/q(		)s   6 
B ?A??Bc                    U R                   (       a0  U R                   R                  R                  U R                   XS9nU$ g)zkTry to make an ID for a parameter in a ParameterSet by calling the
:hook:`pytest_make_parametrize_id` hook.)rd   r  r  N)rd   hookpytest_make_parametrize_id)r   r  r  r>  s       rR   r  IdMaker._idval_from_hook  s>     ;;![[--HH{{ I B IrT   c                   [        U[        [        45      (       a  [        XR                  5      $ Ub%  [        U[
        [        [        [        45      (       a  [        U5      $ [        U[        5      (       a  [        UR                  5      $ U[        L a   g[        U[        R                  5      (       a  [        U5      $ [        [        USS5      [        5      (       a  [        US5      nU$ g)zcTry to make an ID for a parameter in a ParameterSet from its value,
if the value type is supported.Nr   )r   r   bytes_ascii_escaped_by_configrd   floatr  rO   complexr   r   r   r#   enumEnumr   )r   r  rY   s      rR   r  IdMaker._idval_from_value  s     cC<((+C==[JsUCw,GHHs8OW%% --F]  TYY''s8OZ6<<Z0DKrT   c                   U R                  U5      nUb  U$ U R                  b  SU R                   S3nO U R                  b  SU R                   S3nOSnU S[        U5       S[	        U5      < SU S3n[        US	S
9  g)zALike _idval_from_value(), but fails if the type is not supported.NIn r  r  zids contains unsupported value z (type: z) at index zf. Supported types are: str, bytes, int, float, complex, bool, enum, regex or anything with a __name__.Fpytrace)r  r  rk   r   rG   r6   )r   r  r  r>  r  rl   s         rR   r  "IdMaker._idval_from_value_required  s    ##C(>I >>%4>>*"-F[[$4;;-r*FFh5hsm_HTRUYMYdehdi js s 	 	S% rT   c                0    [        U 5      [        U5      -   $ )zfMake an ID for a parameter in a ParameterSet from the argument name
and the index of the ParameterSet.)r   )r  r  s     rR   r  IdMaker._idval_from_argname  s     7|c#h&&rT   rs   N)r   	list[str])r   Iterable[str])r  rF  r  r   r  r  r   r   )r  rF  r  r   r  r  r   r  )r  rF  r  r   r   r  )r  rF  r   r  )r  rF  r  r  r   r   )r  r   r  r  r   r   )r   r   r   r   r   	__slots____annotations__r  r  r   r
  r  r  r  r  r  r   rs   rT   rR   r  r  S  sz     *I )) 0/	''   !F 6* (!& ' 'rT   r  c                  0   \ rS rSr% Sr\R                  " \S9rS\	S'   \R                  " \S9r
S\	S'   \R                  " \S9rS\	S	'   \R                  " \S9rS
\	S'   \R                  " \S9rS\	S'                 SS jrSS jr\SS j5       rSrg)	CallSpec2i  zA planned parameterized invocation of a test function.

Calculated during collection for a given test function's Metafunc.
Once collection is over, each callspec is turned into a single Item
and stored in item.callspec.
)default_factoryzdict[str, object]paramszdict[str, int]indiceszMapping[str, Scope]
_arg2scoper  _idlistz
list[Mark]marksc          
     `   U R                   R                  5       nU R                  R                  5       n[        U R                  5      n	[        X5       H%  u  pX;   a  [        SU
< 35      eXU
'   XhU
'   XYU
'   M'     [        UUU	/ U R                  QUP/ U R                  Q[        U5      QS9$ )Nzduplicate parametrization of )r/  r0  r1  r2  r3  )r/  copyr0  r;  r1  r  r  r-  r2  r3  r5   )r   rw   valsetr>  r3  r  param_indexr/  r0  	arg2scoper{   r  s               rR   setmultiCallSpec2.setmulti  s     !!#,,##%)	H-HC} #@!HII3K&CL"cN .  'dll'B'<DJJ<!4U!;<
 	
rT   c                ^     U R                   U   $ ! [         a  n[        U5      UeS nAff = fr   )r/  KeyErrorr  )r   rY   rb  s      rR   getparamCallSpec2.getparam/  s3    	*;;t$$ 	*T")	*s    
,',c                8    SR                  U R                  5      $ )Nr  )r   r2  r   s    rR   r>  CallSpec2.id5  s    xx%%rT   rs   N)rw   r)  r6  zIterable[object]r>  r   r3  zIterable[Mark | MarkDecorator]r  r>   r7  r  r   r-  )rY   r   r   rF  )r   r   )r   r   r   r   r   dataclassesfieldr;  r/  r+  r0  r1  tupler2  r   r3  r9  r=  r   r>  r   rs   rT   rR   r-  r-    s     !, 1 1$ GFG)//EG^E&1&7&7&MJ#M(..uEG]E#))$?E:?
  
 !	

 
 .
 
 
 

6* & &rT   r-  c                    U R                   $ r   )param)r|  s    rR   get_direct_param_fixture_funcrF  :  s    ==rT   c                      \ rS rSrSr  SSS.         SS jjjr   SSS.             SS jjjr          SS	 jr        SS
 jr      SS jr	      SS jr
Srg)rU   iB  zObjects passed to the :hook:`pytest_generate_tests` hook.

They help to inspect a test function and to generate tests according to
test configuration or values specified in the class or module where a
test function is defined.
NFr5  c                   [        U5        Xl        X0l        XPl        UR                  U l        UR                  U l        X@l        UR                  U l
        / U l        g r   )r*   r[   rd   r   rt   r  names_closurefixturenamesr   name2fixturedefs_arg2fixturedefsr<  )r   r[   r4  rd   r   r   r5  s          rR   r  Metafunc.__init__K  s\     	y! %   # (55  + < < (*rT   )rZ   c                  [         R                  " UUU R                  U R                  U R                  R
                  S9u  pASU;   a
  [        SSS9  Ub-  [        R                  " USU R                  R                   3S9nO[        XR                  U5      nU R                  X5        U(       a,  UR                  (       a  UR                  R                  n	U	b  U	nU R                  XXpR                  R
                  S9nU(       a5  UR                  (       a$  W	c!  [         R#                  UR                  S	U5        Sn
U[        R$                  La  U R                  R&                  nUc   e[)        X5      n
U
cW  U[        R*                  L a  [-        U[.        5      (       d   eUn
O*U[        R0                  L a  UR2                  n
O
 S
U 35       eU
c  SnO"0 nU
R4                  R7                  [8        U5      nU R;                  X5      nU HO  nX   S:X  a  M  Ub
  X;   a  X   nO%[=        U R                  SU[>        USSSS9nUb  UX'   U/U R                  U'   MQ     / nU R@                  =(       d    [C        5       / H]  n[E        [G        XG5      5       HB  u  nu  nnURI                  UURJ                  UURL                  UUS9nURO                  U5        MD     M_     UU l         g)aM
  Add new invocations to the underlying test function using the list
of argvalues for the given argnames. Parametrization is performed
during the collection phase. If you need to setup expensive resources
see about setting indirect to do it rather than at test setup time.

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

::

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

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

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

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

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

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

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

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

:param scope:
    If specified it denotes the scope of the parameters.
    The scope is used for grouping tests by parameter instances.
    It will also override any fixture-function defined scope, allowing
    to set a dynamic scope using test context or configuration.
)rk   r|  zK'request' is a reserved name and cannot be used in @pytest.mark.parametrizeFr#  Nzparametrize() call in )descr_param_ids_generatedzUnhandled missing scope: indirectr  T)rd   baseidr  r  r  r/  r  r5  )rw   r6  r>  r3  r  r7  )(r1   _for_parametrizer  rd   r[   rk   r6   r>   	from_userr   _find_parametrized_scoperM  _validate_if_using_arg_names_param_ids_fromrQ  _resolve_parameter_set_idsrF  __setattr__ro   r   r.   r   r   r   r   r   stash
setdefaultname2pseudofixturedef_key_resolve_args_directnessr+   rF  r<  r-  r  r  r9  r/  r3  r   )r   rw   	argvaluesrR  r  r  rZ   r  scope_generated_idsr   r   name2pseudofixturedefrH   arg_directnessr  
fixturedefnewcallsr7  r7  param_id	param_setnewcallspecs                          rR   rW   Metafunc.parametrizen  s   P #/"?"?MMKK??))#
  ]
 __5dmm6L6L5MNF .h8M8MxXF))(= ;66'77LLM(#--=1G1G . 

 ;66=;P{::<RTWX
 
 '..I(((!)4D| U[[(%i8888$D u}},$,,DE$=eW"EE5<$(!24G$(JJ$9$9)7%! 66xJG&*4$0W5U2;
';;#6 "	
 )45?)2.8\D!!'*%  . 4	}4H6?C'722h	 '//%$++#//  + 0  ,7 5 rT   c           
        Uc  SnSnO=[        U5      (       a  UnSnO(SnU R                  X#U R                  R                  5      n[	        UUUUU R
                  UU R                  R                  S9nUR                  5       $ )a  Resolve the actual ids for the given parameter sets.

:param argnames:
    Argument names passed to ``parametrize()``.
:param ids:
    The `ids` parameter of the ``parametrize()`` call (see docs).
:param parametersets:
    The parameter sets, each containing a set of values corresponding
    to ``argnames``.
:param nodeid str:
    The nodeid of the definition item that generated this
    parametrization.
:returns:
    List with ids for each parameter set given.
N)rk   r  )r  _validate_idsr  r   r  rd   r  )r   rw   r  r  rk   r  ids_id_makers           rR   rY  #Metafunc._resolve_parameter_set_ids#  s    , ;DDc]]DDD%%c$--:P:PQDKKmm,,
 4466rT   c                Z    [        U5      nU[        U5      :w  a,  US:w  a&  Sn[        UR	                  U[        U5      U5      SS9  [        [        R                  " X5      5      $ ! [         a9     [        U5        O! [         a  n[        S5      UeS nAff = f[        U5      n Nf = f)Nz%ids must be a callable or an iterabler   zDIn {}: {} parameter sets specified, with different number of ids: {}Fr#  )r  	TypeErroriterr6   rj   r   	itertoolsislice)r   r  r  r  num_idsrb  rl   s          rR   rk  Metafunc._validate_idsM  s    	)#hG c-((W\XCIs='97CUSI$$S233  	)PS	 P GHaOP-(G	)s5   A' '
B*2A>=B*>
BBBB*)B*c                   [        U[        5      (       a   [        R                  X(       a  SOS5      nU$ [        U[        5      (       aO  [        R                  US5      nU H1  nXA;  a%  [        SU R                  R                   SU S3SS9  SX4'   M3     U$ [        SU R                  R                   S[        U5      R                   3SS9  W$ )	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
parametrized() call.

:param argnames:
    List of argument names passed to ``parametrize()``.
:param indirect:
    Same as the ``indirect`` parameter of ``parametrize()``.
:returns
    A dict mapping each arg name to either "indirect" or "direct".
rR  directr"  z: indirect fixture 'z' doesn't existFr#  z1: expected Sequence or boolean for indirect, got )	r   rO   r;  fromkeysr   r6   r  r   rG   )r   rw   rR  rc  r{   s        rR   r^  !Metafunc._resolve_args_directnessc  s    $ h%%!]]*hN$  (++!]]8X>N&dmm4455I#o^ % '1#    dmm,,- .&&*8n&=&=%>@
 rT   c           
     L   [        [        U R                  5      5      nU R                  R                  nU Hj  nXPR                  ;  d  M  XS;   a  [        SU SU S3SS9  M,  [        U[        5      (       a
  XR;   a  SOSnOU(       a  SOSn[        SU SU S	U S
3SS9  Ml     g)a  Check if all argnames are being used, by default values, or directly/indirectly.

:param List[str] argnames: List of argument names passed to ``parametrize()``.
:param indirect: Same as the ``indirect`` parameter of ``parametrize()``.
:raises ValueError: If validation fails.
r"  z&: function already takes an argument 'z' with a default valueFr#  fixtureargumentz: function uses no z ''N)r%  r   r  r   rK  r6   r   r   )r   rw   rR  default_arg_namesr  r{   rY   s          rR   rW  %Metafunc._validate_if_using_arg_names  s       5dmm DEMM**	C++++i[(NseSij %
 "(H55,/Oy,4y*i[(;D6C5J % rT   )rM  r<  r   rd   r[   rK  r  r   )NN)
r[   r9  r4  zfixtures.FuncFixtureInford   r'   r5  rO   r   r  )FNN)rw   zstr | Sequence[str]r_  z2Iterable[ParameterSet | Sequence[object] | object]rR  bool | Sequence[str]r  ?Iterable[object | None] | Callable[[Any], object | None] | Noner  z_ScopeName | NonerZ   zMark | Noner   r  )
rw   r  r  r  r  r  rk   r   r   r(  )r  zIterable[object | None]r  r  r  r   r   zlist[object | None])rw   r  rR  r  r   z(dict[str, Literal['indirect', 'direct']])rw   r  rR  r  r   r  )r   r   r   r   r   r  rW   rY  rk  r^  rW  r   rs   rT   rR   rU   rU   B  s^    !*  !*&!* .!* 	!* !* 
!*N */OS#'s $(s%s Fs '	s
 Ms !s !s 
sj(7(7 M(7 .	(7
 (7 
(7T4$4 .4 	4
 
4,%% '% 
2	%N ' 
	rT   c                b   [        U[        5      (       a  [        U5      [        U 5      :H  nO[        U5      nU(       a[  U=(       d    0 nUR	                  5        VVs/ s H  u  pVXP;   d  M  US   R
                  PM     nnn[        U[        R                  S9$ [        R                  $ s  snnf )ai  Find the most appropriate scope for a parametrized call based on its arguments.

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

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

Related to issue #1832, based on code posted by @Kingdread.
r  )rH   )	r   r   r  rO   r&  _scopeminr>   ro   )rw   arg2fixturedefsrR  all_arguments_are_fixturesfixturedefsrY   rd  used_scopess           rR   rV  rV    s     (H%%%(]c(m%C"%)(^"!%+ %0$5$5$7
$7  "JrN!!$7 	 
 ;77>>
s   B+-B+c                X    Uc  SnOUR                  S5      nU(       a  U $ [        U 5      $ )NFrN   )r   r   )r  rd   escape_options      rR   r  r    s1    ~R
  37]3%77rT   c                     ^  \ rS rSrSrSrSS\SSSS4               SU 4S jjjr\SU 4S jj5       r	SS jr
\S 5       r\S	 5       rS
 rS r\S 5       rSS jrSS jrSS jr    SS jrSrU =r$ )ro   i  aH  Item responsible for setting up and executing a Python test function.

:param name:
    The full function name, including any decorations like those
    added by parametrization (``my_func[my_param]``).
:param parent:
    The parent Node.
:param config:
    The pytest Config object.
:param callspec:
    If given, this function has been parametrized and the callspec contains
    meta information about the parametrization.
:param callobj:
    If given, the object which will be called when the Function is invoked,
    otherwise the callobj will be obtained from ``parent`` using ``originalname``.
:param keywords:
    Keywords bound to the function object for "-k" matching.
:param session:
    The pytest Session object.
:param fixtureinfo:
    Fixture information already resolved at this fixture node..
:param originalname:
    The attribute name to use for accessing the underlying function object.
    Defaults to ``name``. Set this if name is different from the original name,
    for example when it contains decorations like those added by parametrization
    (``my_func[my_param]``).
FNc
                
  > [         TU ]  XX7S9  U[        La  XPl        [	        USS 5      U l        U	=(       d    UU l        U R                  R                  [        U R                  5      5        U(       a+  X@l        U R                  R                  UR                  5        U R                  R                  S U R                   5       5        U R                  R                  U R                  R                  5        U(       a  U R                  R                  U5        Uc<  U R                   R"                  n
U
R%                  X R                  U R&                  5      nXl        UR*                  U l        U R/                  5         g )N)rd   r   __self__c              3  <   #    U  H  oR                   U4v   M     g 7fr   rX   r   s     rR   r   $Function.__init__.<locals>.<genexpr>  s     L;K4ii.;Kr   )ro  r  r#   r   r   	_instancer8  r   r   r2   rt   r7  r3  r   r   r#  r   rm  getfixtureinfor   rv   rJ  rK  _initrequest)r   rY   r   rd   r7  r3  r   r   r4  r8  fmrq  s              rR   r  Function.__init__  s#    	fF& I$Wj$?DN )0D
 	 2488 <=$M##HNN3 	L4;K;KLLTXX../MM  *--B++D((DHHEK-8'55rT   c                (   > [         TU ]  " SSU0UD6$ )r  r   rs   r  )r   r   r  rq  s      rR   r   Function.from_parent*  s     w"7&7B77rT   c                F    0 U l         [        R                  " U SS9U l        g )NTrH  )ru   r   
TopRequest_requestr   s    rR   r  Function._initrequest/  s    +- ++DDArT   c                ,    [        U R                  5      $ )z$Underlying python 'function' object.)r   rt   r   s    rR   r  Function.function3  s     ""rT   c                     U R                   $ ! [         aV    [        U R                  [        5      (       a"  U R                  5       U l          U R                   $ S U l          U R                   $ f = fr   )r  AttributeErrorr   r   r   _getinstancer   s    rR   r   Function.instance8  s`    	&>>! 	&$++u--!%!2!2!4 ~~ "&~~	&s    >A.A.-A.c                v    [        U R                  [        5      (       a  U R                  R                  5       $ g r   )r   r   r   r  r   s    rR   r  Function._getinstanceD  s)    dkk5));;**,,rT   c                    U R                   nUb  UnO%U R                  c   eU R                  R                  n[        X R                  5      $ r   )r   r   rt   r   r8  )r   r   
parent_objs      rR   r   Function._getobjK  sD    ==!J;;***Jz#4#455rT   c                    U $ )zA(compatonly) for code expecting pytest-2.2 style request objects.rs   r   s    rR   _pyfuncitemFunction._pyfuncitemT  s	     rT   c                6    U R                   R                  U S9  g)z%Execute the underlying test function.)ry   N)r   r~   r   s    rR   runtestFunction.runtestY  s    

%%%6rT   c                8    U R                   R                  5         g r   )r  _fillfixturesr   s    rR   r  Function.setup]  s    ##%rT   c                   [        U S5      (       Ga*  U R                  R                  SS5      (       Gd  [        R                  R
                  R                  [        U R                  5      5      nUR                  UR                  pCUR                  nUR                  X4S9nXe:X  a2  UR                  US9nXe:X  a  UR                  [        5      nU(       d  UnUR                  U5      nU R                  R                  SS5      S:X  a0  [        U5      S:  a!  [!        US	   /S
 USS  5       QUS   P75      nU$ UR                  $ )Nr   	fulltraceF)r   firstlinenor   tbstyleautorO  r   c              3  B   #    U  H  oR                  S 5      v   M     g7f)rL  N)with_repr_style)r   ts     rR   r   -Function._traceback_filter.<locals>.<genexpr>u  s     SBRQ//88BRs   r   r  )rx   rd   rP  _pytest_codeCodefrom_functionr   rt   r   r  rY  cutrZ  r   r  r   )r   excinfocoder   r  rY  
ntracebacks          rR   _traceback_filterFunction._traceback_filter`  s,   4  )>)>{E)R)R==%%33M$((4KLD $		4+;+;+))I"DJJ&'^^^6
*!+!2!23C!DJ%%.
#**73J {{$$Y76Az?Q&!*&qMS*QrBRS 'rN"J    rT   c                h    U R                   R                  SS5      nUS:X  a  SnU R                  XS9$ )Nr  r  longrM  )rd   rP  _repr_failure_py)r   r  rN  s      rR   repr_failureFunction.repr_failure~  s:     %%i8F?E$$W$::rT   )rv   r  r   r  r7  rK  ru   r8  )rY   r   rd   r  r7  zCallSpec2 | Noner   zMapping[str, Any] | Noner   zSession | Noner4  zFuncFixtureInfo | Noner8  r  r   r  r  r  )r  ExceptionInfo[BaseException]r   r   )r  r  r   zstr | TerminalRepr)r   r   r   r   r   r   r#   r  r  r   r  r   r  r   r  r   r  r  r  r  r  r   r  r  s   @rR   ro   ro     s
   : N !%%)-1"&.2#'11 	1
 #1 +1  1 ,1 !1 
1 1h 8 8B # # 	 	6  7&!<;-; 
; ;rT   c                  &    \ rS rSrSrSS jr\rSrg)r9  i  zThis class is a stop gap solution until we evolve to have actual function
definition nodes and manage to get rid of ``metafunc``.c                    [        S5      e)Nz8function definitions are not supposed to be run as tests)RuntimeErrorr   s    rR   r  FunctionDefinition.runtest  s    UVVrT   rs   Nr  )r   r   r   r   r   r  r  r   rs   rT   rR   r9  r9    s    ?W ErT   r9  )rQ   r)   r   r  )r^   rU   r   r  )rd   r'   r   r  )rk   r   r   r  )ry   ro   r   object | None)r   r   r   r  r   znodes.Collector | None)r   r   r   r  r   zModule | None)r   r   r   r)  r   rO   )r   r   r   r   )r   zModule | ClassrY   r   rt   rF  r   zHNone | nodes.Item | nodes.Collector | list[nodes.Item | nodes.Collector])r   r   rd   r'   r  )rt   rF  r  r)  r   r  rE  )r|  r,   r   r   )rw   r  r  z3Mapping[str, Sequence[fixtures.FixtureDef[object]]]rR  r  r   r>   )r  zstr | bytesrd   r  r   r   )r   
__future__r   abccollectionsr   r   rA  r  r  	functoolsr   r   rr  r   pathlibr   typestypingr   r	   r
   r   r   r   r   r   r   r   r   r   rh   r  r   r   _pytest._coder   r   _pytest._code.coder   r   r   _pytest._io.safereprr   _pytest.compatr   r   r   r   r    r!   r"   r#   r%   r&   _pytest.configr'   r(   _pytest.config.argparsingr)   _pytest.deprecatedr*   _pytest.fixturesr+   r,   r-   r.   _pytest.mainr/   _pytest.markr0   r1   _pytest.mark.structuresr2   r3   r4   r5   _pytest.outcomesr6   r7   _pytest.pathlibr9   r:   r;   r<   _pytest.scoper=   r>   _pytest.stashr?   _pytest.warning_typesr@   rA   rB   typing_extensionsrC   rS   r`   re   rm   r~   r   r   r   r   r   Noder   r   	frozensetuniondir
ModuleTyper'  rS  ABCr  rf  Filer   	Directoryr   r{  r  r   r  r  	dataclassr  r-  rF  r   r]  rU   rV  r  Itemro   r9  rs   rT   rR   <module>r     sC   = " 
  #       	                    * % , + ( ) ( 0 ( $ , ' & ! ' ' ! # , - ' + , +   ! % 6 ( 1 7 ! ! & ' 3 # $  " 9 < A &:P
(S 
$ &
'B
8 
$##%(#/5#M# #LK% K%d  __K().
  H*eoosww HV5
55pP
UZZ P
fP eoo P f	g
K g
T d#f' f' $ f'R d#7& 7& $ 7&t
 %T#z#*>%?@B  c c cLH # 	@
8o;z5:: o;d rT   