
    9[gS              
         d Z ddlmZ ddlZddlmZ ddlmZ ddlZddlZddl	Z	ddl
mZ ddlZddlZddlZddlmZ ddlZddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlZddl Z ddl m!Z! ddl m"Z" ddl#m$Z$ ddl#m%Z% ddl&m'Z' ddl&m(Z( ddl&m)Z) ddl*m+Z+ ddl,m-Z- ddl,m.Z. ddl,m/Z/ ddl,m0Z0 dd l,m1Z1 dd!l,m2Z2 dd"l,m3Z3 dd#l,m4Z4 dd$l,m5Z5 dd%l,m6Z6 dd&l7m8Z8 dd'l7m9Z9 dd(l:m;Z; dd)l<m=Z= dd*l>m?Z? dd+l>m@Z@ dd,l>mAZA dd-l>mBZB dd.lCmDZD dd/lEmFZF dd0lEmGZG dd1lHmIZI dd2lHmJZJ dd3lHmKZK dd4lHmLZL dd5lMmNZN dd6lMmOZO dd7lPmQZQ dd8lPmRZR dd9lPmSZS dd:lPmTZT dd;lUmVZV dd<lUmWZW dd=lXmYZY dd>lZm[Z[ dd?lZm\Z\ dd@lZm]Z] erddAl^m_Z_ dodBZ`dpdDZadqdEZbdrdFZc e9dGH      dsdJ       Zd	 	 	 	 	 	 dtdKZedudLZfdvdMZgdwdOZh e9dGH      	 	 	 	 	 	 	 	 dxdP       Zi G dQ dRe"j                        Zk G dS dT      Zlemj                   em        eo ej                  dU            h dV eoel       eo el                   Zq[l G dW dXeke"j                  ej                        Zt	 	 	 	 dydYZu G dZ dNe"j                  et      Zw G d[ d\e"j                        Zydzd]Zzd{d^Z{ G d_ d`et      Z|d|daZ}d|dbZ~e ej                  dGc       G dd de                    Ze ej                  dGc       G df dg                    Zd}dhZ eYeee?e   f             Ze G di dC             Z	 	 	 	 	 	 	 	 d~djZddkZ G dl dIeke"j                        Z G dm dne      Zy)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                    | j                  ddddgd       | j                  dddgd	       | j                  d
ddgd       | j                  dddd       y )Npython_filesargsz	test_*.pyz	*_test.pyz9Glob-style file patterns for Python test module discovery)typedefaulthelppython_classesTestz6Prefixes or glob names for Python test class discoverypython_functionstestzDPrefixes or glob names for Python test function and method 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    I/var/www/html/bid-api/venv/lib/python3.12/site-packages/_pytest/python.pypytest_addoptionrS   T   s    
MMk*H   MME	   MMS	   MMN-	      Metafuncc                    | j                   j                  d      D ],  } | j                  |j                  i |j                  d|i . y )Nparametrizename_param_mark)
definitioniter_markersrW   rF   kwargs)metafuncmarkers     rR   pytest_generate_testsr`   q   sC    %%222FfkkOV]]OO GrT   c                L    | j                  dd       | j                  dd       y )Nmarkersa  parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see https://docs.pytest.org/en/stable/how-to/parametrize.html for more info and examples.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                    d}|dz  }|dz  }|dz  }|dz  }|dz  }|dz  }t        j                  t        |j                  |                    t	        d	       y )
NzFasync def functions are not natively supported and have been skipped.
zMYou need to install a suitable plugin for your async framework, for example:
z
  - anyio
z  - pytest-asyncio
z  - pytest-tornasync
z  - pytest-trio
z  - pytest-twistedz?async def function and no async plugin installed (see warnings))reason)warningswarnrB   formatr7   )nodeidmsgs     rR   async_warn_and_skiprm      sp    
SCXC =C!!C##CCCMM1#**V2DEFQRrT   T)trylastFunctionc           	        | j                   }t        |      rt        | j                         | j                  }| j
                  j                  D ci c]  }|||   
 }} |di |}t        |d      st        |d      rt        | j                         y|/t        j                  t        d| j                   d|d             yc c}w )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.NsXc]".NHO%H%Fv{#wv{'CJ--.  
	&%j&7&7%8
6* M_ _	
  Ps   Cc                    | dz  }	 |j                         }|rt        j                  ||       S y # t        $ r Y y w xY w)N__init__.pypath)is_filePermissionErrorPackagefrom_parent)r   parentpkginithas_pkginits       rR   pytest_collect_directoryr      sQ     ]"Goo' ""6"55  s   1 	==c                   | j                   dk(  rq|j                  j                  |       s&t        | |j                  j                  d            sy |j                  j                  |       }|j                  | |      }|S y )Nz.pyrE   module_pathr   )suffixsession
isinitpathpath_matches_patternsrd   getinigethookproxypytest_pycollect_makemodule)	file_pathr   ihookmodules       rR   pytest_collect_filer      s{    5 ~~((3(6==//? ++I6::!& ; 
 rT   c                ,     t         fd|D              S )zKReturn whether path matches any of the patterns in the list of globs given.c              3  6   K   | ]  }t        |        y wNr8   ).0patternr   s     rR   	<genexpr>z(path_matches_patterns.<locals>.<genexpr>   s     AWz'4(s   )any)r   patternss   ` rR   r   r      s    AAAArT   Modulec                0    t         j                  ||       S )Nr   )r   r   r   s     rR   r   r      s    f;77rT   c                   t        | t        t        f      sJ t        |              t	        |      r+| j                  ||      rt        j                  | ||      S y | j                  ||      rt        |d|      }t        j                  |      s_t        j                  t        |            sAt        |      \  }}t        j                  t        d|d      d t!        |      |dz          y t        |dd      rt#        |      r_t$        j                  | |	      }d
| d}|j'                  t)        j*                  d|             |j-                  t        |             |S t/        | j1                  ||            S y )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      sj    i%1B4	?B1C  d+$$YTs$CC8 7 
	!	!#t	,c:s+ ""3'7+=+=mC>P+Q*3/Hf""/%dX-KL Xz&  S*d+C **94*@?vEUV  x~~%GH089
I33D#>??rT   c                      e Zd ZdZdZed        Zed        Zed        Zed        Z	e	j                  d        Z	d Zddd	Zdd
Zy)
PyobjMixinzthis mix-in inherits from Node to carry over the typing information

    as its intended to always mix in before a node
    its position in the mro is unaffectedTc                L    | j                  t              }||j                  S dS )z@Python module object this node was collected from (can be None).N)	getparentr   rt   selfnodes     rR   r   zPyobjMixin.module  s&     ~~f%+txx55rT   c                L    | j                  t              }||j                  S dS )z?Python class object this node was collected from (can be None).N)r   r   rt   r   s     rR   clszPyobjMixin.cls  s&     ~~e$+txx55rT   c                     y)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   instancezPyobjMixin.instance  s     rT   c                   t        | dd      }|}| j                         x| _        }| j                  rZ| j                  j                  t        | j                               | j                  j                  d | j                  D               |S )zUnderlying Python object._objNc              3  8   K   | ]  }|j                   |f  y wr   rX   r   marks     rR   r   z!PyobjMixin.obj.<locals>.<genexpr>#  s     $TCS4dii%6CS   )
r   _getobjr   _ALLOW_MARKERSown_markersextendr2   rt   keywordsupdater   rt   s     rR   rt   zPyobjMixin.obj  sw     dFD);"lln,DI ""  ''(:488(DE $$$T4CSCS$TT
rT   c                    || _         y r   )r   )r   values     rR   rt   zPyobjMixin.obj&  s	    	rT   c                v    | j                   J | j                   j                  }t        || j                        S )zCGet the underlying Python object. May be overwritten by subclasses.)r   rt   r   rY   r   s     rR   r   zPyobjMixin._getobj*  s2     {{&&&kkoosDII&&rT   c                >   g }| j                         D ]h  }|j                  }t        |t              r9t        j
                  j                  |      d   }|r|r|j                  |        n|j                  |       j |j                          dj                  |      S )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   
getmodpathzPyobjMixin.getmodpath1  s    %%'D99D$'ww''-a0$T*LL ( 	xxrT   c                \    t        | j                        \  }}| j                         }|||fS r   )r   rt   r   )r   r   r   modpaths       rR   
reportinfozPyobjMixin.reportinfo@  s-    "488,f//#VW$$rT   N)TF)r   rO   r   rO   returnr   )r   z.tuple[os.PathLike[str] | str, int | None, str])__name__
__module____qualname____doc__r   propertyr   r   r   rt   setterr   r   r   rs   rT   rR   r   r      s    -
 N6 6
 6 6
     	ZZ '%rT   r   c                      e Zd Zy)_EmptyClassN)r   r   r   rs   rT   rR   r   r   K  s    rT   r   empty_module>   __file__
__cached____builtins__c                  L    e Zd Zd
dZddZd
dZddZddZddZddZ	ddZ
y	)PyCollectorc                &    | j                  d|      S )NrL   _matches_prefix_or_glob_optionr   rY   s     rR   funcnamefilterzPyCollector.funcnamefilter\  s    223EtLLrT   c                     t        |dd      du S )zgLook for the __test__ attribute, which is applied by the
        @nose.tools.istest decorator.
        r   FTr$   r   s     rR   
isnosetestzPyCollector.isnosetest_  s     CU3t;;rT   c                &    | j                  d|      S )NrJ   r   r   s     rR   classnamefilterzPyCollector.classnamefilterh  s    223CTJJrT   c                    | j                  |      s| j                  |      rGt        |t        t        f      rt        |dd      }t        |      xr t        j                  |      d u S y)Nr   F)	r   r   r   staticmethodclassmethodr%   callabler   getfixturemarkerr   rt   rY   s      rR   r   zPyCollector.istestfunctionk  sZ    t$(<#k:;"3
E:C=KX%>%>s%Ct%KKrT   c                v    | j                  |      s| j                  |      syt        j                  |      ryy)NFT)r   r   r   
isabstractr  s      rR   r   zPyCollector.istestclasst  s2    $$T*dooc.Bc"rT   c                    | j                   j                  |      D ]:  }|j                  |      r yd|v s	d|v sd|v s#t        j                  ||      s: y y)z`Check 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   z*PyCollector._matches_prefix_or_glob_option{  s\     kk((5Fv& -3&=C6MwfH  6 rT   c                   t        | j                  dd      sg S t        | j                  di       g}t        | j                  t              r6| j                  j                  D ]  }|j                  |j                          t               }g }| j                  }|D ]  }g }t        |j                               D ]n  \  }}	|t        v r||v r|j                  |       |j                  | ||	      }
|
<t        |
t              r|j                  |
       ^|j                  |
       p |j                  |        g }t        |      D ]  }|j                  |        |S )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   collectzPyCollector.collect  sC   txxT2I :r23dhh%88++W--. ,
 @B

C9;F "#))+.	c--4<55"3 6  ;T*MM#&MM#& / v&' . {+FMM&! ,rT   c           	   #  :  K   | j                  t              }|J |j                  }| j                  t              }|xr |j                  xs d }t        j                  | ||      }|j                  }t        ||| j                  ||d      }	g }
t        |d      r|
j                  |j                         |,t        |d      r |
j                   |       j                         | j                  j                  j                  |
t        |	             |	j                  st         j                  | ||       y |j#                          |	j                  D ]=  }| d|j$                   d}t         j                  | ||||j$                  di|	       ? y w)
N)rY   callobjT)r[   fixtureinford   r   r   	_ispytestr`   )r^   )rY   r   r
  ])rY   callspecr   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[   r   r^   methodsr#  subnames                rR   r   zPyCollector._genfunctions  sx    NN6*	$$$&#+t'33DtW3U
 -- !#;;
 623NN6778?ws,CDNN35667

((33GT8=TU&&t$K&PP --/$OO!F!HKK=2** % +&kk40!% +   ,s   FFN)rY   r   r   rO   rt   objectr   rO   )rt   r1  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  r   rs   rT   rR   r   r   [  s-    M<K)V.rT   r   c                   |j                  d      }	 t        | ||j                  |j                  d            }|j0                  j3                  |       |S # t        $ rG}t
        j                  j                  t        j                         j                  d            |d }~wt        $ r<}t
        j                  j                   dj                  |j                         |d }~wt        $ r}t        j                         }|j                         dk  r$|j                   j#                  t$              |_        |j                   r|j                  d      n|j'                         }t)        |      }t
        j                  j                  d|  d	|       |d }~wt*        j,                  $ r2}|j.                  r t
        j                  j                  d
      |d }~ww xY w)Nz--import-modeconsider_namespace_packages)moderootr4  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   importtestmodulerQ    s   
 !!/2J-(.6S(T	
Z ((-JQ  oo**&&(00w0?
	 # 	oo**@ 9 :@I
 	   --/!A%!)!3!3!:!:;K!LH !! 7+!!# 	
 8}oo**7v > n

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

 	s=   (A 	G$!AB##G$/7C&&G$2B*FG$2-GG$c                  :     e Zd ZdZd Zd fdZddZddZ xZS )r   z<Collector for test classes and functions in a Python module.c                B    t        | j                  | j                        S r   )rQ  r   rd   r   s    rR   r   zModule._getobj!  s    		4;;77rT   c                    | j                          | j                          | j                  j                  j	                  |        t
        |          S r   )_register_setup_module_fixture _register_setup_function_fixturer   _fixturemanagerparsefactoriessuperr  r   	__class__s    rR   r  zModule.collect$  s@    ++---/$$33D9w  rT   c                   t        | j                  d      t        | j                  d      yd	fd}| j                  j                  j	                  d| j                  j
                   || j                  dd       y)
a"  Register an autouse, module-scoped fixture for the collected module object
        that invokes setUpModule/tearDownModule if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        setUpModulesetup_moduletearDownModuleteardown_moduleNc              3  h   K   | j                   }t        |       d  t        |       y y wr   )r   _call_with_optional_argument)requestr   r_  rb  s     rR   xunit_setup_module_fixturezIModule._register_setup_module_fixture.<locals>.xunit_setup_module_fixture;  s8     ^^F',\6B*,_fE +s   /2_xunit_setup_module_fixture_r   TrY   funcrk   scopeautouser   zGenerator[None]_get_first_non_fixture_funcrt   r   rW  _register_fixturer   rk   )r   rf  r_  rb  s     @@rR   rU  z%Module._register_setup_module_fixture*  s     3HH5
 6HH;
 O$;	F 	$$66/0A0A/BC+;; 	7 	
rT   c                   t        | j                  d      t        | j                  d      yd	fd}| j                  j                  j	                  d| j                  j
                   || j                  dd       y)
a*  Register an autouse, function-scoped fixture for the collected module object
        that invokes setup_function/teardown_function if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        )setup_function)teardown_functionNc              3     K   | j                   d  y | j                  }t        |       d  t        |       y y wr   )r   functionrd  )re  rt  rq  rr  s     rR   xunit_setup_function_fixturezMModule._register_setup_function_fixture.<locals>.xunit_setup_function_fixtureZ  sO     + ''H),^XF ,,->I -s   A A_xunit_setup_function_fixture_rt  Trh  rl  rm  )r   ru  rq  rr  s     @@rR   rV  z'Module._register_setup_function_fixtureL  s     5TXX?RS7HH,
 !&7&?	J 	$$661$((2C2C1DE-;; 	7 	
rT   r2  r   None)	r   r   r   r   r   r  rU  rV  __classcell__r[  s   @rR   r   r     s    F8! 
D"
rT   c                  L     e Zd ZdZ	 	 	 	 d	 	 	 	 	 	 	 d fdZddZddZ xZS )	r   a|  Collector for files and directories in a Python packages -- directories
    with an `__init__.py` file.

    .. note::

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

    .. versionchanged:: 8.0

        Now inherits from :class:`~pytest.Directory`.
    c                H    |j                   }t        | 	  ||||||       y )N)fspathr   r   rd   r   rk   )r   rY  __init__)r   r}  r   rd   r   rk   r   r[  s          rR   r~  zPackage.__init__  s2     .. 	 	
rT   c                    t        | j                  dz  | j                        }t        |d      }|t	        ||       t        |d      }|#t        t        ||      }| j                  |       y y )Nr   r]  r`  )rQ  r   rd   rn  rd  r   addfinalizer)r   init_modr_  rb  ri  s        rR   setupzPackage.setup  sy    #DII$=t{{K 35
 #(x@5;
 &7(SDd# 'rT   c              #  D  K   dd}| j                   }| j                  }t        | j                  |      D ]  }|j	                         rat        |j                        }| j                  j                  |d      s|j                  ||      rY|j                  ||       }|o| t|j                         st        |j                        }| j                  j                  |      s|j                  ||      r|j                  ||       }|E d {     y 7 w)Nc                8    | j                   dk7  | j                   fS )Nr   rX   )entrys    rR   sort_keyz!Package.collect.<locals>.sort_key  s    JJ-/<<rT   T)with_parents)collection_pathrd   )r   r   )r   r   )r  zos.DirEntry[str]r   r1  )rd   r   r<   r   is_dirr   r   r   pytest_ignore_collectr   r   r   )r   r  rd   r   direntryr   colcolss           rR   r  zPackage.collect  s     	=  

		84H HMM*||..t$.G224PV2W 44$t4L?I!!#HMM*||..t4224PV2W 0040M! 5   s   B!D $D :AD DD )NNNN)r}  zLEGACY_PATH | Noner   nodes.Collectorr   zPath | Noner   rx  rw  r2  )r   r   r   r   r~  r  r  ry  rz  s   @rR   r   r   q  sK    &  
"
  
 
 

,$$ rT   r   c                    | j                   j                  }t        j                  |       r|dz  }|r	 | |       y |         y)zyCall the given function with the given argument if func accepts one argument, otherwise
    calls func without arguments.r   N)__code__co_argcountr   ismethod)ri  r{   	arg_counts      rR   rd  rd    s9     ))IQ	S	rT   c                d    |D ]+  }t        | |d      }|t        j                  |      )|c S  y)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   rn  rn    s<     %c46 9 9$ ? GK  rT   c                  V     e Zd ZdZeddd	 fd       Zd Zd
 fdZddZddZ	 xZ
S )r   zBCollector for test methods (and nested classes) in a Python class.Nrt   c               (    t        |   d||d|S )The public constructor.)rY   r   rs   rY  r   )r   r   rY   rt   kwr[  s        rR   r   zClass.from_parent  s     w"BVBrBBrT   c                "    | j                         S r   r  r   s    rR   newinstancezClass.newinstance  s    xxzrT   c           	        t        | j                  dd      sg S t        | j                        rY| j                  J | j	                  t        d| j                  j                  d| j                  j                   d             g S t        | j                        rY| j                  J | j	                  t        d| j                  j                  d| j                  j                   d             g S | j                          | j                          | j                  j                  j                  | j                         | j                         t        | A         S )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   rW  rX  r  rY  r  rZ  s    rR   r  zClass.collect  s2   DHHj$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                   t        | j                  d      t        | j                  d      yd	fd}| j                  j                  j	                  d| j                  j
                   || j                  dd       y)
a!  Register an autouse, class scoped fixture into the collected class object
        that invokes setup_class/teardown_class if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        )setup_class)teardown_classNc              3     K   | j                   }t              }t        ||       d  t              }t        ||       y y wr   )r   r   rd  )re  r   ri  r  r  s      rR   xunit_setup_class_fixturezFClass._register_setup_class_fixture.<locals>.xunit_setup_class_fixture  sL     ++C& -,T37) 0,T37 *s   AA_xunit_setup_class_fixture_classTrh  rl  rn  rt   r   rW  ro  r   rk   )r   r  r  r  s     @@rR   r  z#Class._register_setup_class_fixture  s~     2$((<LM4TXX?RS>#9	8 	$$66.txx/D/D.EF*;; 	7 	
rT   c                "   dt        | j                  f      dt        | j                  f      yd	fd}| j                  j                  j	                  d| j                  j
                   || j                  dd       y)
a'  Register an autouse, function scoped fixture into the collected class object
        that invokes setup_method/teardown_method if either or both are available.

        Using a fixture to invoke these methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        setup_methodteardown_methodNc              3     K   | j                   }| j                  }t        |      }t        ||       d  t        |      }t        ||       y y wr   )r   rt  r   rd  )re  r   methodri  r  
setup_namer  teardown_names       rR   xunit_setup_method_fixturezHClass._register_setup_method_fixture.<locals>.xunit_setup_method_fixture0  s]     ''H%%F'x4,T6:*x7,T6: +s   AA_xunit_setup_method_fixture_rt  Trh  rl  r  )r   r  r  r  r  r  s     @@@@rR   r  z$Class._register_setup_method_fixture"  s     $
2488j]K)5dhh@PQO$;		; 		; 	$$66/0E0E/FG+;; 	7 	
rT   r   rC   r2  rw  )r   r   r   r   r  r   r  r  r  r  ry  rz  s   @rR   r   r     s1    L.2 C C!:
> 
rT   r   c                H    t        | dd       }|r|t        j                  k7  S y)Nr~  F)r   r1  r~  )rt   inits     rR   r  r  E  s%    3
D1Dv&&rT   c                H    t        | dd       }|r|t        j                  k7  S y)N__new__F)r   r1  r  )rt   news     rR   r  r  L  s%    #y$/C
fnn$$rT   )frozenc                      e Zd ZU dZdZded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   ddZddZddZddZ	ddZ
ddZddZed d       Zy)!IdMakerz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                
   t        | j                               }t        |      t        t        |            k7  rt	        |      }t        t              }t        |      D ]w  \  }}||   dkD  sd}|r|d   j                         rd}| | ||    }|t        |      v r&||xx   dz  cc<   | | ||    }|t        |      v r&|||<   ||xx   dz  cc<   y t        |      t        t        |            k(  s
J d|       |S )a  Make a unique identifier for each ParameterSet, that may be used to
        identify the parametrization in a node ID.

        Format is <prm_1_token>-...-<prm_n_token>[counter], where prm_x_token is
        - user-provided id, if given
        - else an id derived from the value, applicable for certain types
        - else <argname><parameterset index>
        The counter suffix is appended only in case a string wouldn't be unique
        otherwise.
        r    _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_idsz$IdMaker.make_unique_parameterset_idsv  s,    D--/0|C$5 66-I*5c*:K&|4	rR=1$Fbfnn.!$ "tF8KO+<=F C$55#B1,$&4xB/@!A !C$55 +1L'Oq(O 5 < C%
 
 	.+l_-	. 
 rT   c              #     K   t         j                        D ]  \  }|j                  |j                   ! j                  rIt	         j                        k  r1 j                     " j                   j                            vdj                   fdt        |j                   j                        D                yw)z;Resolve IDs for all ParameterSets (may contain duplicates).N-c              3  J   K   | ]  \  }}j                  ||        y wr   )_idval)r   valargnameidxr   s      rR   r   z'IdMaker._resolve_ids.<locals>.<genexpr>  s*      (OW KKWc2(Os    #)
r  r  r*  r  r  _idval_from_value_requiredr   zipr  rw   )r   parametersetr  s   ` @rR   r  zIdMaker._resolve_ids  s     !*4+=+=!>C*"oo%cCM1dhhsm6O55dhhsmSII hh (+L,?,?(O   "?s   C
Cc                    | j                  |||      }||S | j                  ||      }||S | j                  |      }||S | j                  ||      S )z-Make an ID for a parameter in a ParameterSet.)_idval_from_function_idval_from_hook_idval_from_value_idval_from_argname)r   r  r  r  idvals        rR   r  zIdMaker._idval  sl    ))#w<L%%c73L&&s+L''55rT   c                
   | j                   y	 | j                  |      }|y| j                  |      S # t        $ rE}| j                  | j                   dnd}d}||j                  ||      z   }t	        |      |d}~ww xY w)zjTry to make an ID for a parameter in a ParameterSet using the
        user-provided id callable, if given.N: r  zJerror raised while trying to determine id of parameter '{}' at position {})r  rG  rk   rj   
ValueErrorr  )r   r  r  r  r*  rM  prefixrl   s           rR   r  zIdMaker._idval_from_function  s     99	)3B :%%b))  	)+/;;+B}B'F^C3::gs33CS/q(		)s   4 	BA A==Bc                    | j                   r4| j                   j                  j                  | j                   ||      }|S y)zsTry 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  zIdMaker._idval_from_hook  s@     ;;![[--HH{{W I B IrT   c                   t        |t        t        f      rt        || j                        S | t        |t
        t        t        t        f      rt        |      S t        |t              rt        |j                        S |t        u r	 yt        |t        j                        rt        |      S t        t        |dd      t              rt        |d      }|S y)zkTry to make an ID for a parameter in a ParameterSet from its value,
        if the value type is supported.Nr   )r   r   bytes_ascii_escaped_by_configrd   floatr  rO   complexr   r   r   r#   enumEnumr   )r   r  rY   s      rR   r  zIdMaker._idval_from_value  s     cC<(+C==[JsUCw,GHs8OW% --F]  TYY's8OZ6<Z0DKrT   c                    | j                  |      }||S | j                  d| j                   d}n| j                  d| j                   d}nd}| dt        |       dt	        |      d| d}t        |d	
       y)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  z"IdMaker._idval_from_value_required  s    ##C(>I >>%4>>*"-F[[$4;;-r*FFh5hsm_HTRUYMYdehdi js s 	 	S% rT   c                0    t        |       t        |      z   S )znMake an ID for a parameter in a ParameterSet from the argument name
        and the index of the ParameterSet.)r   )r  r  s     rR   r  zIdMaker._idval_from_argname  s     7|c#h&&rT   N)r   	list[str])r   Iterable[str])r  r1  r  r   r  r  r   r   )r  r1  r  r   r  r  r   r  )r  r1  r  r   r   r  )r  r1  r   r  )r  r1  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  rs   rT   rR   r  r  S  sz     *I )) 0/	''   !F 6* (!& ' 'rT   r  c                  @   e Zd ZU dZ ej
                  e      Zded<    ej
                  e      Z	ded<    ej
                  e      Z
ded<    ej
                  e      Zd	ed
<    ej
                  e      Zded<   	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZedd       Zy)	CallSpec2zA 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          
     h   | j                   j                         }| j                  j                         }t        | j                        }	t        ||      D ]&  \  }
}|
|v rt        d|
      |||
<   |||
<   ||	|
<   ( t        |||	g | j                  |g | j                  t        |            S )Nzduplicate parametrization of )r   r  r  r  r  )r   copyr  r'  r  r  r  r  r  r  r5   )r   rw   valsetr*  r  rj  param_indexr   r  	arg2scoper{   r  s               rR   setmultizCallSpec2.setmulti  s     !!#,,##%)	Hf-HCf} #@!HIIF3K&GCL"IcN .  'dll'B'<DJJ<!4U!;<
 	
rT   c                \    	 | j                   |   S # t        $ r}t        |      |d }~ww xY wr   )r   KeyErrorr  )r   rY   rM  s      rR   getparamzCallSpec2.getparam/  s3    	*;;t$$ 	*T")	*s    	+&+c                8    dj                  | j                        S )Nr  )r   r  r   s    rR   r*  zCallSpec2.id5  s    xx%%rT   N)rw   r  r  zIterable[object]r*  r   r  zIterable[Mark | MarkDecorator]rj  r>   r  r  r   r  )rY   r   r   r1  )r   r   )r   r   r   r   dataclassesfieldr'  r   r  r  r  tupler  r   r  r
  r  r   r*  rs   rT   rR   r  r    s     !2 1 1$ GFG/k//EG^E&7k&7&7&MJ#M.[..uEG]E)))$?E:?
  
 !	

 
 .
 
 
 

6* & &rT   r  c                    | j                   S r   )param)re  s    rR   get_direct_param_fixture_funcr  :  s    ==rT   c                      e Zd ZdZ	 	 ddd	 	 	 	 	 	 	 	 	 ddZ	 	 	 ddd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 dd	Z	 	 	 	 	 	 dd
Z	 	 	 	 	 	 ddZ	y)rU   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r!  c                   t        |       || _        || _        || _        |j                  | _        |j                  | _        || _        |j                  | _
        g | _        y r   )r*   r[   rd   r   rt   rt  names_closurefixturenamesr   name2fixturedefs_arg2fixturedefsr(  )r   r[   r   rd   r   r   r!  s          rR   r~  zMetafunc.__init__K  sd     	y! %   # (55  + < < (*rT   )rZ   c                  t        j                  ||| j                  | j                  | j                  j
                        \  }}~d|v rt        dd       |/t        j                  |d| j                  j                         }nt        || j                  |      }| j                  ||       |r&|j                  r|j                  j                  }	|	|	}| j                  |||| j                  j
                        }|r/|j                  r#	!t         j#                  |j                  d	|       d}
|t        j$                  urx| j                  j&                  }|J t)        ||      }
|
P|t        j*                  u rt-        |t.              sJ |}
n)|t        j0                  u r|j2                  }
n
J d
|        |
d}n"i }|
j4                  j7                  t8        |      }| j;                  ||      }|D ]O  }||   dk(  r|
||v r||   }n(t=        | j                  d|t>        |ddd      }||||<   |g| j                  |<   Q g }| j@                  xs tC               gD ]^  }tE        tG        ||            D ]D  \  }\  }}|jI                  ||jJ                  ||jL                  ||      }|jO                  |       F ` || _         y)a  Add new invocations to the underlying test function using the list
        of argvalues for the given argnames. Parametrization is performed
        during the collection phase. If you need to setup expensive resources
        see about setting indirect to do it rather than at test setup time.

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

        ::

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

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

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

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

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

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

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

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

        :param scope:
            If specified it denotes the scope of the parameters.
            The scope is used for grouping tests by parameter instances.
            It will also override any fixture-function defined scope, allowing
            to set a dynamic scope using test context or configuration.
        )rk   re  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  ri  rj  r   r  r!  )rw   r  r*  r  rj  r  )(r1   _for_parametrizert  rd   r[   rk   r6   r>   	from_userr   _find_parametrized_scoper  _validate_if_using_arg_names_param_ids_fromr  _resolve_parameter_set_idsr1  __setattr__ro   r   r.   r   r   r   r   r   stash
setdefaultname2pseudofixturedef_key_resolve_args_directnessr+   r  r(  r  r  r  r
  r  r  r   )r   rw   	argvaluesr  r  rj  rZ   r  scope_generated_idsr   r   name2pseudofixturedefrH   arg_directnessr  
fixturedefnewcallsr#  r  param_id	param_setnewcallspecs                          rR   rW   zMetafunc.parametrizen  s   P #/"?"?MMKK??))#
-  ]
 __5dmm6L6L5MNF .h8M8MxXF))(H= ;66'77LLM(#--c=1G1G . 

 ;66=;P{::<RTWX
 
 '..I(((!)V4D| U[[(%i888$D u}},$,,DE$=eW"EE5<$(!24G$(JJ$9$9)7%! 66xJGg&*4$0W@U5U27;
';;#6 "	
 )45?)'2.8\D!!'*%  . 4	}4H6?C'722h	 '//%$++#//  + 0  ,7 5 rT   c           	        |d}d}n9t        |      r|}d}n)d}| j                  ||| j                  j                        }t	        ||||| j
                  || j                  j                        }|j                         S )a:  Resolve the actual ids for the given parameter sets.

        :param argnames:
            Argument names passed to ``parametrize()``.
        :param ids:
            The `ids` parameter of the ``parametrize()`` call (see docs).
        :param parametersets:
            The parameter sets, each containing a set of values corresponding
            to ``argnames``.
        :param nodeid str:
            The nodeid of the definition item that generated this
            parametrization.
        :returns:
            List with ids for each parameter set given.
        N)rk   r  )r  _validate_idsrt  r   r  rd   r  )r   rw   r  r  rk   r  ids_id_makers           rR   r&  z#Metafunc._resolve_parameter_set_ids#  s    , ;DDc]DDD%%c=$--:P:PQDKKmm,,
 4466rT   c                X   	 t        |      }|t        |      k7  r.|dk7  r)d}t        |j	                  |t        |      |      d       t        t        j                  ||            S # t        $ r8 	 t        |       n# t        $ r}t        d      |d }~ww xY wt        |      }Y w xY w)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_idsrM  rl   s          rR   r7  z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                   t        |t              r"t        j                  ||rd      }|S d      }|S t        |t              rPt        j                  |d      }|D ]3  }||vr(t        d| j                  j                   d| dd       d||<   5 |S t        d| j                  j                   dt        |      j                   d       S )	a  Resolve if each parametrized argument must be considered an indirect
        parameter to a fixture of the same name, or a direct parameter to the
        parametrized function, based on the ``indirect`` parameter of the
        parametrized() call.

        :param argnames:
            List of argument names passed to ``parametrize()``.
        :param indirect:
            Same as the ``indirect`` parameter of ``parametrize()``.
        :returns
            A dict mapping each arg name to either "indirect" or "direct".
        r  directr  z: indirect fixture 'z' doesn't existFr  z1: expected Sequence or boolean for indirect, got )	r   rO   r'  fromkeysr   r6   rt  r   rG   )r   rw   r  r0  r{   s        rR   r+  z!Metafunc._resolve_args_directnessc  s    $ h%!]]*N$ # 7?N$  (+!]]8X>Nh&dmm4455I#o^ % '1s#    dmm,,- .&&*8n&=&=%>@
 rT   c           
     6   t        t        | j                              }| j                  j                  }|D ]`  }|| j                  vs||v rt        d| d| dd       +t        |t              r	||v rdnd}n|rdnd}t        d| d| d	| d
d       b y)a4  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   rt  r   r  r6   r   r   )r   rw   r  default_arg_namesr  r{   rY   s          rR   r$  z%Metafunc._validate_if_using_arg_names  s       5dmm DEMM**	C$+++++i[(NseSij %
 "(H5,/8Oy,4y*i[(;D6C5J % rT   )NN)
r[   r%  r   zfixtures.FuncFixtureInford   r'   r!  rO   r   rx  )FNN)rw   zstr | Sequence[str]r,  z2Iterable[ParameterSet | Sequence[object] | object]r  bool | Sequence[str]r  ?Iterable[object | None] | Callable[[Any], object | None] | Nonerj  z_ScopeName | NonerZ   zMark | Noner   rx  )
rw   r  r  rI  r  r  rk   r   r   r  )r  zIterable[object | None]r  r  r  r   r   zlist[object | None])rw   r  r  rH  r   z(dict[str, Literal['indirect', 'direct']])rw   r  r  rH  r   rx  )
r   r   r   r   r~  rW   r&  r7  r+  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                @   t        |t              rt        |      t        |       k(  }nt        |      }|rT|xs i }|j	                         D cg c]  \  }}|| v r|d   j
                   }}}t        |t        j                        S t        j                  S c c}}w )a}  Find the most appropriate scope for a parametrized call based on its arguments.

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

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

    Related to issue #1832, based on code posted by @Kingdread.
    r  )rH   )	r   r   r  rO   r  _scopeminr>   ro   )rw   arg2fixturedefsr  all_arguments_are_fixturesfixturedefsrY   r1  used_scopess           rR   r#  r#    s     (H%%(]c(m%C"%)(^"!%+ %0$5$5$7
$7 jx rN!!$7 	 
 ;77>>
s   Bc                L    |d}n|j                  d      }|r| S t        |       S )NFrN   )r   r   )r  rd   escape_options      rR   r  r    s1    ~R
  37]3%77rT   c                       e Zd ZdZdZddeddddf	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZed fd       ZddZ	e
d        Ze
d        Zd	 Zd
 Ze
d        ZddZddZddZ	 	 	 	 ddZ xZS )ro   a  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         |   ||||       |t        ur|| _        t	        |dd       | _        |	xs || _        | j                  j                  t        | j                               |r,|| _        | j                  j                  |j                         | j                  j                  d | j                  D               | j                  j                  | j                  j                         |r| j                  j                  |       |=| j                   j"                  }
|
j%                  | | j                  | j&                        }|| _        |j*                  | _        | j/                          y )N)rd   r   __self__c              3  8   K   | ]  }|j                   |f  y wr   rX   r   s     rR   r   z$Function.__init__.<locals>.<genexpr>  s     L;K4dii.;Kr   )rY  r~  r#   r   r   	_instancer$  r   r   r2   rt   r#  r  r   r   r  r   rW  getfixtureinfor   rv   r  r  _initrequest)r   rY   r   rd   r#  r  r   r   r   r$  fmr[  s              rR   r~  zFunction.__init__  s/    	vfgF& DI$Wj$?DN )0D
 	 2488 <=$DM##HNN3 	L4;K;KLLTXX../MM  *--B++D$((DHHEK-8'55rT   c                &    t        |   dd|i|S )r  r   rs   r  )r   r   r  r[  s      rR   r   zFunction.from_parent*  s     w"7&7B77rT   c                J    i | _         t        j                  | d      | _        y )NTr  )ru   r   
TopRequest_requestr   s    rR   rY  zFunction._initrequest/  s    +- ++DDArT   c                ,    t        | j                        S )z$Underlying python 'function' object.)r   rt   r   s    rR   rt  zFunction.function3  s     ""rT   c                    	 | j                   S # t        $ rE t        | j                  t              r| j                         | _         nd | _         Y | j                   S w xY wr   )rW  AttributeErrorr   r   r   _getinstancer   s    rR   r   zFunction.instance8  sP    	&>>! 	&$++u-!%!2!2!4!%~~	&s    A AAc                l    t        | j                  t              r| j                  j                         S y r   )r   r   r   r  r   s    rR   rb  zFunction._getinstanceD  s&    dkk5);;**,,rT   c                    | j                   }||}n$| j                  J | j                  j                  }t        || j                        S r   )r   r   rt   r   r$  )r   r   
parent_objs      rR   r   zFunction._getobjK  sF    ==!J;;***Jz4#4#455rT   c                    | S )zA(compatonly) for code expecting pytest-2.2 style request objects.rs   r   s    rR   _pyfuncitemzFunction._pyfuncitemT  s	     rT   c                <    | j                   j                  |        y)z%Execute the underlying test function.)ry   N)r   r~   r   s    rR   runtestzFunction.runtestY  s    

%%%6rT   c                8    | j                   j                          y r   )r^  _fillfixturesr   s    rR   r  zFunction.setup]  s    ##%rT   c                   t        | d      r&| j                  j                  dd      s	t        j                  j
                  j                  t        | j                              }|j                  |j                  }}|j                  }|j                  ||      }||k(  r0|j                  |      }||k(  r|j                  t              }|s|}|j                  |      }| j                  j                  dd      dk(  r/t        |      dkD  r!t!        |d	   gd
 |dd D        |d         }|S |j                  S )Nr   	fulltraceF)r   firstlinenor   tbstyleautor:  r   c              3  >   K   | ]  }|j                  d         yw)r7  N)with_repr_style)r   ts     rR   r   z-Function._traceback_filter.<locals>.<genexpr>u  s     SBRQa//8BRs   r   r  )rx   rd   r;  _pytest_codeCodefrom_functionr   rt   r   rn  rD  cutrE  r   r  r   )r   excinfocoder   rn  rD  
ntracebacks          rR   _traceback_filterzFunction._traceback_filter`  s.   4 )>)>{E)R==%%33M$((4KLD $		4+;+;+D))I"DkJJY&'^^^6
*!+!2!23C!DJ%%.
#**73J {{$$Y76Az?Q&!*&qMS*QrBRS 'rN"J    rT   c                n    | j                   j                  dd      }|dk(  rd}| j                  ||      S )Nro  rp  longr8  )rd   r;  _repr_failure_py)r   ry  r9  s      rR   repr_failurezFunction.repr_failure~  s<     %%i8F?E$$WE$::rT   )rY   r   rd   r  r#  zCallSpec2 | Noner   zMapping[str, Any] | Noner   zSession | Noner   zFuncFixtureInfo | Noner$  r  r   rx  r  rw  )ry  ExceptionInfo[BaseException]r   r   )ry  r  r   zstr | TerminalRepr)r   r   r   r   r   r#   r~  r  r   rY  r   rt  r   rb  r   rg  ri  r  r|  r  ry  rz  s   @rR   ro   ro     s    : N !%%)-1"&.2#'11 	1
 #1 +1  1 ,1 !1 
1h 8 8B # # 	 	6  7&!<;-; 
;rT   c                      e Zd ZdZddZeZy)r%  zThis class is a stop gap solution until we evolve to have actual function
    definition nodes and manage to get rid of ``metafunc``.c                    t        d      )Nz8function definitions are not supposed to be run as tests)RuntimeErrorr   s    rR   ri  zFunctionDefinition.runtest  s    UVVrT   Nrw  )r   r   r   r   ri  r  rs   rT   rR   r%  r%    s    ?W ErT   r%  )rQ   r)   r   rx  )r^   rU   r   rx  )rd   r'   r   rx  )rk   r   r   rx  )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   r1  r   zHNone | nodes.Item | nodes.Collector | list[nodes.Item | nodes.Collector])r   r   rd   r'   rw  )rt   r1  r  r  r   r  r0  )re  r,   r   r   )rw   r  rM  z3Mapping[str, Sequence[fixtures.FixtureDef[object]]]r  rH  r   r>   )r  zstr | bytesrd   r  r   r   )r   
__future__r   abccollectionsr   r   r  r  r  	functoolsr   r   r=  r   pathlibr   typestypingr   r	   r
   r   r   r   r   r   r   r   r   r   rh   rt  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  r>  ABCr   rQ  Filer   	Directoryr   rd  rn  r   r  r  	dataclassr  r  r  r   r*  rU   r#  r  Itemro   r%  rs   rT   rR   <module>r     sM   = " 
  #       	                    * % , + ( ) ( 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
 AHT#z#*>%?@B  c c cLH # 	@
8o;z5:: o;d rT   