
    Xiå                    &   S 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rSSKrSSKrSSKrSSKrSSKrSS	KJr  SSKrSS
K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rSSKJr  SSKJ r   SSKJ!r!  SSKJ"r"  SSKJ#r#  SSKJ$r$  SSK%J&r&  SSK%J'r'  SSK(J)r)  SSK*J+r+  SSK,J-r-  SSK,J.r.  SSK,J/r/  SSK,J0r0  SSK,J1r1  SSK,J2r2  SSK3J4r4  SS K3J5r5  SS!K6J7r7  SS"K6J8r8  SS#K9J:r:  \(       a  SS$K;J<r<  SS%K=J>r>  SHS& jr?SIS' jr@      SJS( jrASKS) jrBSLS+ jrCSMS, jrDSNS- jrESOS. jrFSPS/ jrG      SQS0 jrHSRS1 jrI " S2 S35      rJ " S4 S5\K5      rL " S6 S7\M5      rN\R                   " S8 S9\P\\Q4   5      5       rR\ " S: S;\R                  5      5       rT\ " S< S*\R                  5      5       rVS=S>.     SSS? jjrW\R                  " S@SA9 " SB SC5      5       rXS=S=SD.           STSE jjrY      SUSF jrZ    SVSG jr[g)WzHCore implementation of the testing process: init, session, runtest loop.    )annotationsN)Callable)Iterable)Iterator)Sequence)Set)Path)final)Literal)overload)TYPE_CHECKING)nodes)Config)directory_arg)ExitCode)hookimpl)PytestPluginManager)
UsageError)OverrideIniAction)Parser)PathAwareHookProxy)exitabsolutepath)bestrelpath
fnmatch_ex)safe_exists)samefile_nofollow)scandir)CollectReport)
TestReport)collect_one_node)
SetupState)PytestWarning)Self)FixtureManagerc                   U R                  S5      nUR                  SSSSSSS9  UR                  S	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  U R                  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 5      nUR                  S!S"S#S$S%9  U R                  S&S'S(S)9  U R                  S*S+5      nUR                  S,S-S.S/S0S%9  UR                  S1S/S2S%9  UR                  S3S#S4S5S69  UR                  S7S#S4S8S69  UR                  S9S#S:S;S69  UR                  S<S=S S>[        R                  " [        S<S?9S@SA9  UR                  SBS/SCSSDSE9  UR                  SFSGS/SHSSISE9  UR                  SJS/SKSSLSE9  UR                  SMS/SSNSOSP9  UR                  SQSR/ SSQSTSUSV9  U R                  SWSXSY/ SZQS9  U R                  S[S\SY/ S9  U R                  S]S^SS_S9  U R                  S`SSSaSb9  U R                  ScSd5      nUR                  SeSfSg[        ShSiSj9  UR                  SkSSlSmSn9  UR                  SoSpS [        S>SqSr9  g )sNgeneralz-xz--exitfirststore_constmaxfail   z,Exit instantly on first error or failed test)actiondestconsthelpz	--maxfailnumstorer   z'Exit after first num failures or errors)metavarr-   typer.   defaultr0   z--strict-configstrict_configtruez Enables the strict_config option)r-   
ini_option	ini_valuer0   z--strict-markersstrict_markersz!Enables the strict_markers optionz--strictstrictzEnables the strict optionzbAny warnings encountered while parsing the `pytest` section of the configuration file raise errorsbool)r4   r5   zVMarkers not registered in the `markers` section of the configuration file raise errorszrEnables all strictness options, currently: strict_config, strict_markers, strict_xfail, strict_parametrization_idsFzpytest-warningsz-Wz--pythonwarningsappendz<Set which warnings to report, see -W option of Python itself)r-   r0   filterwarningslinelistz_Each line specifies a pattern for warnings.filterwarnings. Processed after -W/--pythonwarnings.)r4   r0   collect
collectionz--collectonlyz--collect-onlyz--co
store_truez&Only collect tests, don't execute themz--pyargsz1Try to interpret all arguments as Python packagesz--ignorepathz-Ignore path during collection (multi-allowed))r-   r3   r0   z--ignore-globz5Ignore path pattern during collection (multi-allowed)z
--deselectnodeid_prefixzDDeselect item (via node id prefix) during collection (multi-allowed)z--confcutdir
confcutdirdir)optnamez1Only load conftest.py's relative to specified dir)r.   r5   r3   r4   r0   z--noconftest
noconftestz Don't load any conftest.py files)r-   r.   r5   r0   z--keepduplicatesz--keep-duplicateskeepduplicateszKeep duplicate testsz--collect-in-virtualenvcollect_in_virtualenvz2Don't ignore tests in a local virtualenv directoryz--continue-on-collection-errorscontinue_on_collection_errorsz4Force test execution even if collection errors occur)r-   r5   r.   r0   z--import-modeprepend)rL   r=   	importlib
importmodez\Prepend/append to sys.path when importing test modules and conftest files. Default: prepend.)r5   choicesr.   r0   norecursedirsz)Directory patterns to avoid for recursionargs)	z*.eggz.*_darcsbuildCVSdistnode_modulesvenvz{arch}	testpathszZDirectories to search for tests when no files or directories are given on the command linecollect_imported_testsz@Whether to collect tests in imported modules outside `testpaths`Tconsider_namespace_packageszEConsider namespace packages when resolving module names during import)r4   r5   r0   debugconfigz(test session debugging and configurationz-cz--config-fileFILEinifilenamezcLoad configuration from `FILE` instead of trying to locate one of the implicit configuration files.)r3   r4   r.   r0   z	--rootdirrootdirzDefine root directory for tests. Can be relative path: 'root_dir', './root_dir', 'root_dir/another_dir/'; absolute path: '/home/user/root_dir'; path with variables: '$HOME/root_dir'.)r-   r.   r0   z
--basetempbasetempz^Base temporary directory for this test run. (Warning: this directory is removed if it exists.))r.   r5   r4   r3   r0   )getgroup
_addoption	addoptionintr   addini	functoolspartialr   strvalidate_basetemp)parsergroups     ?/var/www/html/venv/lib/python3.13/site-packages/_pytest/main.pypytest_addoptionrl   :   s   OOI&E	;   
OO6   
OO "/   
OO #0   
OO (   MM	*   MM	   MM	R   OO-.E	OOK	   MM/   OOI|4E	OO5   
OO@  
 
OO<	   
OOD	   
OOS	   
OO}nE@   
OO/   
OO#   
OO!$A   
OO),C   
OO2#   MM3

	    MM	   MM J	   MM%T	   OOM+UVE	(   
OO	   
OOA  
    c                   SnU (       d  [         R                  " U5      eSS jnU" [        R                  " 5       [        U 5      R	                  5       5      (       a  [         R                  " U5      eU" [        R                  " 5       R                  5       [        U 5      R                  5       5      (       a  [         R                  " U5      eU $ )NzWbasetemp must not be empty, the current working directory or any parent directory of itc                *    X:X  a  gXR                   ;   $ )z,Return whether query is an ancestor of base.T)parents)basequerys     rk   is_ancestor&validate_basetemp.<locals>.is_ancestor   s    =$$rm   )rq   r	   rr   r	   returnr<   )argparseArgumentTypeErrorr	   cwdabsoluteresolve)rC   msgrs   s      rk   rh   rh     s    
cC ((--% 488:tDz22455((-- 488:%%'d););)=>>((--Krm   c           	     <	   [         R                  U 5      n[        R                  Ul        Sn  U R                  5         SnU R                  R                  US9  SnU" X5      =(       d    SUl        Sn[H        RJ                  " URL                  5        US:  a$   U R                  RO                  X"R                  S
9  U RQ                  5         UR                  $ ! [         a    [        R                  Ul        e [         a    [        R                  Ul         N[        [        R                  4 a    [        R                   R"                  R%                  5       n[        R&                  n[)        UR*                  [        R                  5      (       av  UR*                  R,                  b  UR*                  R,                  nUS:  aC  [.        R0                  R3                  UR4                   SUR*                  R6                   S35        U R                  R9                  US9  XRl         GN[:         Ga    [        R<                  Ul        [        R                   R"                  R%                  5       n U R?                  X@R@                  5        [)        UR*                  [B        5      (       a  [.        R0                  R3                  S	5         GN^! [        R                   ab  nUR,                  b  UR,                  Ul        [.        R0                  R3                  [E        U5      RF                   SU S35         SnA GNSnAff = ff = f! [        R                   aa  nUR,                  b  UR,                  Ul        [.        R0                  R3                  [E        U5      RF                   SU S35         SnAGNSnAff = f! Sn[H        RJ                  " URL                  5        US:  a   U R                  RO                  X"R                  S
9  Ow! [        R                   a`  nUR,                  b  UR,                  Ul        [.        R0                  R3                  [E        U5      RF                   SU S35         SnAOSnAff = fU RQ                  5         f = f)zSkeleton command line program.r   r,   session   Nz: 
)excinfoz(mainloop: caught unexpected SystemExit!
)r~   
exitstatus))Sessionfrom_configr   OKr   _do_configurehookpytest_sessionstartr   USAGE_ERRORFailedTESTS_FAILEDKeyboardInterruptr   	Exception_pytest_codeExceptionInfofrom_currentINTERRUPTED
isinstancevalue
returncodesysstderrwritetypenamer{   pytest_keyboard_interruptBaseExceptionINTERNAL_ERRORnotify_exceptionoption
SystemExitr4   __name__oschdir	startpathpytest_sessionfinish_ensure_unconfigure)configdoitr~   	initstater   r   excs          rk   wrap_sessionr   1  s    !!&)G!GI0% 	R  "IKK++G+<I!%f!6!;!G> 
""#>C00#0B0B 1  	""$U  	!)!5!5G 	7!)!6!6G!4>>2 		,mm11>>@G)1)=)=J'--88==++7!(!9!9Jq=JJ$$(8(8'9GMM<M<M;Nb%QRKK11'1B!+ 	R!)!8!8Gmm11>>@GR''? gmmZ88JJ$$%PQ >> C>>-),G&

  DI$6$6#7r#b!ABBC	R, >> C>>-),G&

  DI$6$6#7r#b!ABBC 
""#>C00#0B0B 1  >> C>>-),G&

  DI$6$6#7r#b!ABBC 	""$s   AC #M >M
O DM
)O ,AM
4K>M
O M$AM:M
>O MM

O O!AN==O)R/#PRR'AR=RRRc                "    [        U [        5      $ N)r   _mainr   s    rk   pytest_cmdline_mainr   l  s    &&rm   r   c                    U R                   R                  US9  U R                   R                  US9  UR                  (       a  [        R
                  $ UR                  S:X  a  [        R                  $ g)zWDefault command line protocol for initialization, session,
running tests and reporting.r}   r   N)r   pytest_collectionpytest_runtestlooptestsfailedr   r   testscollectedNO_TESTS_COLLECTED)r   r~   s     rk   r   r   p  s`     KK!!'!2
KK""7"3$$$			1	$***rm   c                $    U R                  5         g r   )perform_collectr}   s    rk   r   r   }  s    rm   c                   U R                   (       aX  U R                  R                  R                  (       d3  U R	                  U R                    SU R                   S:w  a  SOS S35      eU R                  R                  R
                  (       a  g[        U R                  5       H  u  pUS-   [        U R                  5      :  a  U R                  US-      OS nUR                  R                  R                  X#S9  U R                  (       a  U R                  U R                  5      eU R                  (       d  M  U R	                  U R                  5      e   g)Nz errorr,   s z during collectionT)itemnextitem)r   r   r   rK   Interruptedcollectonly	enumerateitemslenr   pytest_runtest_protocol
shouldfailr   
shouldstop)r~   ir   r   s       rk   r   r     s   7>>#8#8#V#V!!""#61D1D1I#r)RRde
 	
 ~~((W]]++,q53w}}3E+E7==Q'400d0N..!3!344%%g&8&899 , rm   c                     U R                  S5      R                  5       =(       d     U R                  SS5      R                  5       $ ! [         a     gf = f)a  Attempt to detect if ``path`` is the root of a Virtual Environment by
checking for the existence of the pyvenv.cfg file.

[https://peps.python.org/pep-0405/]

For regression protection we also check for conda environments that do not include pyenv.cfg yet --
https://github.com/conda/conda/issues/13337 is the conda issue tracking adding pyenv.cfg.

Checking for the `conda-meta/history` file per https://github.com/pytest-dev/pytest/issues/12652#issuecomment-2246336902.

z
pyvenv.cfgz
conda-metahistoryF)joinpathis_fileOSErrorrC   s    rk   _in_venvr     sR    MM,'//1 @}}\95==?	
  s   AA 
AAc                  ^  T R                   S:X  a  gUR                  ST R                  S9nU=(       d    / nUR                  S5      nU(       a  UR	                  S U 5       5        T U;   a  gUR                  ST R                  S9nU=(       d    / nUR                  S5      nU(       a  UR	                  S	 U 5       5        [        U 4S
 jU 5       5      (       a  gUR                  S5      nU(       d  [        T 5      (       a  gT R                  5       (       a,  UR                  S5      n[        U 4S jU 5       5      (       a  gg )N__pycache__Tcollect_ignorer   ignorec              3  8   #    U  H  n[        U5      v   M     g 7fr   r   .0xs     rk   	<genexpr>(pytest_ignore_collect.<locals>.<genexpr>  s     @ZLOOZ   collect_ignore_globignore_globc              3  8   #    U  H  n[        U5      v   M     g 7fr   r   r   s     rk   r   r     s     D^LOO^r   c              3  v   >#    U  H.  n[         R                   " [        T5      [        U5      5      v   M0     g 7fr   )fnmatchrg   )r   globcollection_paths     rk   r   r     s(     
U7??3/T;;s   69rJ   rP   c              3  <   >#    U  H  n[        UT5      v   M     g 7fr   r   )r   patr   s     rk   r   r     s     M;LCz#//;Ls   )	name_getconftest_pathlistparent	getoptionextendanyr   is_dirgetini)r   r   ignore_paths
excludeoptignore_globsexcludegloboptallow_in_venvnorecursepatternss   `       rk   pytest_ignore_collectr     s0   },//55 0 L  %2L!!(+J@Z@@,&//O$:$: 0 L  %2L%%m4ND^DD

U
UUU$$%<=MXo66"MM/:M;LMMMrm   c                (    [         R                  XS9$ )Nr   )Dirfrom_parentrC   r   s     rk   pytest_collect_directoryr     s     ??6?--rm   c                F   [        UR                  S5      =(       d    / 5      nU(       d  g / n/ nU  HG  nUR                  R                  U5      (       a  UR	                  U5        M6  UR	                  U5        MI     U(       a  UR
                  R                  US9  X0S S & g g )Ndeselect)r   )tupler   nodeid
startswithr=   r   pytest_deselected)r   r   deselect_prefixes	remaining
deselectedcolitems         rk   pytest_collection_modifyitemsr     s    f..z:@bAIJ>>$$%677g&W%	  %%J%7a rm   c                  4    \ rS rSr      SS jrSS jrSrg)FSHookProxyi  c                    Xl         X l        g r   pmremove_mods)selfr  r  s      rk   __init__FSHookProxy.__init__  s    
 &rm   c                h    U R                   R                  XR                  S9nX R                  U'   U$ )N)remove_plugins)r  subset_hook_callerr  __dict__)r  r   r   s      rk   __getattr__FSHookProxy.__getattr__  s0    GG&&t<L<L&Mdrm   r  N)r  r   r  zAbstractSet[object]ru   None)r   rg   ru   zpluggy.HookCaller)r   
__module____qualname____firstlineno__r  r  __static_attributes__ rm   rk   r  r    s(    '' )' 
	'rm   r  c                      \ rS rSrSrSrSrg)r   i  z*Signals that the test run was interrupted.builtinsr  Nr   r  r  r  __doc__r  r  rm   rk   r   r     s
    4Jrm   r   c                      \ rS rSrSrSrg)r   i  z"Signals a stop as failed test run.r  Nr  r  rm   rk   r   r     s    ,rm   r   c                  .    \ rS rSr% SrS\S'   SS jrSrg)	_bestrelpath_cachei   r   r	   rC   c                :    [        U R                  U5      nX U'   U$ r   )r   rC   )r  rC   rs      rk   __missing___bestrelpath_cache.__missing__  s    		4(T
rm   r  N)rC   r	   ru   rg   )r   r  r  r  	__slots____annotations__r  r  r  rm   rk   r  r     s    I
Jrm   r  c                  P   ^  \ rS rSrSr\      SU 4S jj5       rSS jrSrU =r	$ )r   i  zCollector of files in a file system directory.

.. versionadded:: 8.0

.. note::

    Python directories with an `__init__.py` file are instead collected by
    :class:`~pytest.Package` by default. Both are :class:`~pytest.Directory`
    collectors.
c                  > [         TU ]  XS9$ )zThe public constructor.

:param parent: The parent collector of this Dir.
:param path: The directory's path.
:type path: pathlib.Path
)r   rC   )superr   )clsr   rC   	__class__s      rk   r   Dir.from_parent  s     w"&"<<rm   c              #  `  #    U R                   nU R                  n[        U R                  5       H  nUR	                  5       (       ad  [        UR                  5      nU R                  R                  USS9(       d  UR                  XAS9(       a  Mb  UR                  X@S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                  XAS9(       a  M  UR                  X@S9nU S h  vN   M     g  N	7f)NTwith_parents)r   r   r   	file_pathr   )r   ihookr    rC   r   r	   r~   
isinitpathr   r   r   pytest_collect_file)r  r   r-  direntryrC   colcolss          rk   r@   Dir.collect(  s      

		*H  HMM*||..t$.G2242W 44$4L?I # !!##HMM*||..t442242W 0040M! +   s   B=D.AD."D,#
D.r  )r   nodes.CollectorrC   r	   ru   r&   )ru   z&Iterable[nodes.Item | nodes.Collector])
r   r  r  r  r  classmethodr   r@   r  __classcell__r&  s   @rk   r   r     sB    	 == 	=
 
= =   rm   r   c                    ^  \ rS rSr% Sr\r\rS\S'   S\S'   S\S'   S"U 4S	 jjr\	S#S
 j5       r
S$S jr\S%S j5       r\R                  S&S j5       r\S%S j5       r\R                  S&S j5       r\S'S j5       rS(S jr\" SS9S)S j5       r\" SS9S*S j5       r\rSS.     S+S jjrS,S jr      S-S jr\ S.     S/S jj5       r\ S.     S0S jj5       r S1     S0S jjr S2     S3S jjrS4S jrS5S  jrS!rU =r$ )6r   i@  zgThe root of the collection tree.

``Session`` collects the initial paths given as arguments to pytest.
r$   _setupstater'   _fixturemanagerint | ExitCoder   c           
       > [         TU ]  SUR                  S S UU SS9  SU l        SU l        SU l        SU l        UR                  R                  R                  S5      U l        [        5       U l        [        5       U l        / U l        / U l        0 U l        / U l        [#        UR                  5      U l        U R&                  R(                  R+                  U SS9  g )Nr   )r   rC   fspathr   r   r~   r   r   FrA   r~   )r   )r$  r  rootpathr   r   _shouldstop_shouldfailtracerootget	frozenset_initialpaths_initialpaths_with_parents	_notfound_initial_parts_collection_cacher   r  _bestrelpathcacher   pluginmanagerregister)r  r   r&  s     rk   r  Session.__init__O  s     	 	
 ',',\\&&**<8
.7k;D;'FH8:GI')
2DV__2U!!**4i*@rm   c                $    U R                  US9nU$ )Nr   )_create)r%  r   r~   s      rk   r   Session.from_configi  s    ;;f;5rm   c           	         SU R                   R                   SU R                   SU R                   SU R                   S3	[        U SS5      -  $ )N< z exitstatus=%r testsfailed=z testscollected=>r   z<UNSET>)r&  r   r   r   r   getattrr  s    rk   __repr__Session.__repr__n  s_    ''($)) 5++, -"112!5 D,	23 	3rm   c                    U R                   $ r   )r?  rV  s    rk   r   Session.shouldstopv      rm   c                z    USL a0  U R                   (       a  [        R                  " [        S5      SS9  g Xl         g )NFzCsession.shouldstop cannot be unset after it has been set; ignoring.r   
stacklevel)r?  warningswarnr%   r  r   s     rk   r   rZ  z  :     E>d..MMY 	  rm   c                    U R                   $ r   )r@  rV  s    rk   r   Session.shouldfail  r[  rm   c                z    USL a0  U R                   (       a  [        R                  " [        S5      SS9  g Xl         g )NFzCsession.shouldfail cannot be unset after it has been set; ignoring.r   r]  )r@  r_  r`  r%   ra  s     rk   r   rd    rb  rm   c                B    U R                   R                  R                  $ )zAThe path from which pytest was invoked.

.. versionadded:: 7.0.0
)r   invocation_paramsrF   rV  s    rk   r   Session.startpath  s     {{,,000rm   c                     U R                   U   $ r   )rJ  )r  	node_paths     rk   _node_location_to_relpath!Session._node_location_to_relpath  s    %%i00rm   T)tryfirstc                    U R                   (       a  U R                  U R                   5      eU R                  (       a  U R                  U R                  5      eg r   )r   r   r   r   rV  s    rk   pytest_collectstartSession.pytest_collectstart  s=    ??++doo..??""4??33 rm   c                   UR                   (       aq  [        US5      (       d_  U =R                  S-  sl        U R                  R	                  S5      nU(       a'  U R                  U:  a  SU R                   S3U l        g g g g g )Nwasxfailr,   r+   zstopping after z	 failures)failedhasattrr   r   getvaluer   )r  reportr+   s      rk   pytest_runtest_logreport Session.pytest_runtest_logreport  so    ==!<!<!kk**95G4++w6$3D4D4D3EY"O 7w "==rm   Fr)  c                   [        U[        5      (       a  UO
[        U5      nU(       a  X0R                  ;   $ X0R                  ;   $ )a  Is path an initial path?

An initial path is a path explicitly given to pytest on the command
line.

:param with_parents:
    If set, also return True if the path is a parent of an initial path.

.. versionchanged:: 8.0
    Added the ``with_parents`` parameter.
)r   r	   rF  rE  )r  rC   r*  path_s       rk   r.  Session.isinitpath  s<    $ #4..DJ;;;;....rm   c                4   [        U[        5      (       a  UO
[        U5      nU R                  R                  nUR	                  U5      nUR
                  R                  U5      nU(       a  [        [        X55      5      nU$ U R                  R                  nU$ r   )
r   r	   r   rK  _getconftestmodules_conftest_plugins
differencer   r  r   )r  r=  rC   r  my_conftestmodulesr  proxys          rk   gethookproxySession.gethookproxy  s    #FD11vtF|[[&&  33D9**556HI&{2'CDE  KK$$Erm   c                    X;   a  X!   $ UR                  5       (       a3  U R                  UR                  5      nUR                  XS9nUb  U4OSnO8UR	                  5       (       a!  U R                  U5      nUR                  XS9nOSnXRU'   U$ )zuCreate a Collector for the given path.

`path_cache` makes it so the same Collectors are returned for the same
path.
r   r  r+  )r   r  r   r   r   r/  )r  rC   
path_cacher-  r1  r2  s         rk   _collect_pathSession._collect_path  s     ##;;==%%dkk2E*/*H*H +I +C 9<sfRD\\^^%%d+E,,t,ID D4rm   c                    g r   r  r  rQ   genitemss      rk   r   Session.perform_collect  s      #rm   c                    g r   r  r  s      rk   r   r    s     25rm   c                :   Uc  U R                   R                  nU R                  SX5        U R                  R                  =R                  S-  sl        U R                   R
                  n/ U l        / U l        0 U l        / U l	        U R                  nU R                   R                  S5      n / n/ n[        U5       VV	s/ s HN  u  p[        U R                   R                  R                  U	UU R                   R                  R                   US9PMP     n
nn	U R                   R#                  S5      (       d  [%        U
5      U l        OXl        U R                   H^  nUR'                  UR(                  5        UR'                  UR(                  5        UR+                  UR(                  R,                  5        M`     [/        U5      U l        [/        U5      U l        [5        U 5      nU R6                  R9                  US9  U R                  R                  =R                  S-  sl        U R                  (       aU  / nU R                   H;  u  pU(       a  UR'                  SU	 SU< S	35        M'  UR'                  S
U	 35        M=     [;        U6 eU(       d  UR<                  nONUR>                  (       a=  UR<                   H-  nU R                  R+                  U RA                  U5      5        M/     U R                   RB                  RE                  5         URG                  X R                   US9  / U l        / U l        0 U l        URI                  U S9  U(       a  [K        U5      U l&        U$ s  sn	nf ! / U l        / U l        0 U l        URI                  U S9  f = f)a3  Perform the collection phase for this session.

This is called by the default :hook:`pytest_collection` hook
implementation; see the documentation of this hook for more details.
For testing purposes, it may also be called directly on a fresh
``Session``.

This function normally recursively expands any collectors collected
from the session to their items, and only items are returned. For
testing purposes, this may be suppressed by passing ``genitems=False``,
in which case the return value contains these collectors unexpanded,
and ``session.items`` is empty.
r   r,   rZ   	as_pypathrZ   rI   rv  znot found: z
(no match in any of )zfound no collectors for )r~   r   r   r}   )'r   rQ   rA  rB  indentr   rG  rH  rI  r   r   r   resolve_collection_argumentrg  rF   r   pyargsr   normalize_collection_argumentsr=   rC   r   rp   rD  rE  rF  r#   r-  pytest_collectreportr   resultpassedr  rK  check_pendingr   pytest_collection_finishr   r   )r  rQ   r  r   r   rZ   initialpathsinitialpaths_with_parentsr   argcollection_argscollection_argumentreperrors
collectorsnodes                   rk   r   r  	  s     <;;##D

$d1

!#{{ !#
8<

,0KK,>,>)-
#:	8')L46% (o	 .FA ,KK1155"kk00770K .  	 ;;(()9::&D_&U#&5#'+':':###$7$<$<=)001D1I1IJ)001D1I1I1Q1QR (; "+<!8D.78Q.RD+"4(CJJ++3+7JJOO""a'"~~'+~~OC!)#.DZNRST (@&FG (6 !&))

:: #



))$--*=> !+ KK%%335..[[ /   DN"$D%'D"))$)7"%e*Dw	f  DN"$D%'D"))$)7s    /M4 AM.HM4 .M4 4&Nc                    XR                   ;   a  U(       a  U R                   U   nUS4$ [        U5      nX0R                   U'   US4$ )NTF)rI  r#   )r  r  handle_dupesr  s       rk   _collect_one_nodeSession._collect_one_nodej  sN    
 )))l((.C9"4(C+.""4(:rm   c              #  t  #    0 nU R                   R                  nU R                   GH  nU R                  SU5        U R                  R                  =R
                  S-  sl        UR                  nUR                  nUR                  nUR                  nUR                  5       (       a  U(       a   SXE4< 35       eU/nUc>  UR                   H-  n	UR                  U	5      (       d    O}UR                  SU	5        M/     OfUR                  S5      n
[        UR                  S5       H;  u  pU[!        U
5      :  d  U	R"                  X*    :w  a    OUR                  SU	5        M=     Sn/ nU / UQUQ4/nU(       GaJ  UR%                  5       u  nnU(       d  Uv   SnM*  ['        U[(        R*                  5      (       d  MK  ['        U[,        5      (       a0  ['        US   [.        5      (       d   eUR1                  US   U5      nO[!        U5      S:H  =(       a-    ['        US   [.        5      =(       a    US   R3                  5       (       + nU R5                  UU5      u  nnU(       d*  UR6                  (       d  UR8                  R;                  US	9  UR6                  (       d  GM1  UR<                  nSn[?        U5       H  n['        US   [.        5      (       aG  UR                  US   :H  n[@        RB                  S
:X  a   U(       d  [E        UR                  US   5      nO_[!        U5      S:X  a>  Ub  URF                  US   U-   :H  nO7URF                  R                  S5      S   US   :H  nOURF                  US   :H  nU(       d  M  URI                  UUSS  45        SnM     U(       d  URI                  U5        U(       a  GMJ  U(       d;  SRK                  [M        U5      /UQ75      nU RN                  RI                  UU45        U R                  R                  =R
                  S-  sl        GM     g 7f)Nzprocessing argumentr,   zinvalid arg r   .r   FTr  win32[::)(r   rK  rH  rA  rB  r  rC   partsparametrizationmodule_namer   rp   _is_in_confcutdirinsertsplitr   r   stempopr   r   	Collectorr   r	   r  r   r  r  r-  r  r  reversedr   platformr   r   r=   joinrg   rG  )r  r  r  r  argpathnamesr  r  pathsrC   module_name_partsr   any_matched_in_initial_partnotfound_collectorswork	matchnode
matchpartssubnodesr  r  	duplicateany_matched_in_collectorr  is_match
report_args                            rk   r@   Session.collectw  s     =?
[[&&#'#6#6JJ,.ABJJOO""a'")..G'--E1AAO-99K ~~ EL'1A0D"EEyIE "#OOD//55LLD) , %0$5$5c$:!(!<GA3011TYYBSTVBW5WLLD)  = +0'"$'''(QD (,
%	: "#O26/ ")U__== i11%jmT::::(66z!}jQH
 J1, 4&z!}d;4&qM113$L
 &*%;%;I|%TNC$SZZ "<<C<H:: "zzH ,1($X.D!*Q-66#'99
1#=<<728
 (9JqM'RH z?a/.:+/99
18W+W
 ,099??3+?+BjQRm+S'+yyJqM'AHxT:ab>$:;3707 /: 0'..y9M $P /!YYG'=u'=>
%%z3F&GHJJOO""a'""e $7s   NP8	;P8A1P8c              #    #    U R                  SU5        [        U[        R                  5      (       a  UR                  R                  US9  Uv   g [        U[        R                  5      (       d   e[        U[        R                  5      (       + nU R                  X5      u  p4UR                  (       a,  UR                   H  nU R                  U5       S h  vN   M     U(       d  UR                  R                  US9  g g  N*7f)Nr  )r   r  )rA  r   r   Itemr-  pytest_itemcollectedr  Filer  r  r  r  r  )r  r  r  r  r  subnodes         rk   r  Session.genitems  s     

:t$dEJJ''JJ+++6JdEOO4444)$

;;L!33DGNCzz"zzG#}}W555  *

//s/;  6s   CDD+D)rJ  rI  rH  rE  rF  rG  r@  r?  r   r   r   r   rA  )r   r   ru   r  )r   r   ru   r   )ru   rg   )ru   
bool | str)r   r  ru   r  )ru   r	   )rj  r	   ru   rg   )ru   r  )rv  zTestReport | CollectReportru   r  )rC   zstr | os.PathLike[str]r*  r<   ru   r<   )r=  zos.PathLike[str]ru   zpluggy.HookRelay)rC   r	   r  z%dict[Path, Sequence[nodes.Collector]]ru   zSequence[nodes.Collector])..)rQ   Sequence[str] | Noner  zLiteral[True]ru   zSequence[nodes.Item])rQ   r  r  r<   ru   z&Sequence[nodes.Item | nodes.Collector])NT)T)r  r4  r  r<   ru   ztuple[CollectReport, bool])ru   z&Iterator[nodes.Item | nodes.Collector])r  znodes.Item | nodes.Collectorru   zIterator[nodes.Item]) r   r  r  r  r  r   r   r!  r  r5  r   rW  propertyr   setterr   r   rk  r   ro  rw  r  r.  r  r  r   r   r  r@   r  r  r6  r7  s   @rk   r   r   @  s    
 KF##A4  3     ! !     ! ! 1 11 t4 4 tP P 4 #	/$/ 	/
 
/0" : 
#	> JM#(#:G#	# # AD5(5:>5	/5 5
 CG_(_;?_	/_H "  
$	z(x< <rm   FrZ   c               ~    [         R                  R                  U 5      nUc  gUR                  b  [        UR                  5      S:X  a  UR                  $ U(       a  UR                  S   $ UR                  c  g[        R                  R                  UR                  5      $ ! [        [        [
        4 a     gf = f)z]Search sys.path for the given a dotted module name, and return its file
system path if found.Nr   )rM   util	find_specAttributeErrorImportError
ValueErrorsubmodule_search_locationsr   originr   rC   dirname)r  rZ   specs      rk   search_pypathr    s    
~~''4 | 	''/t../14 {{" ..q11{{77??4;;''/ K4 s   B$ $B<;B<T)frozenc                  L    \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'   S
\S'   Srg)CollectionArgumenti(  zA resolved collection argument.r	   rC   zSequence[str]r  
str | Noner  r  rc   original_indexr  N)r   r  r  r  r  r!  r  r  rm   rk   r  r  (  s"    )
Jrm   r  r  c                  UR                  S5      u  pVnUR                  S5      tpU(       a  U	(       d  [        SU 35      eU(       a  U U 3OSn
SnU(       a  [        XS9nUb  UnUnX-  n[	        U5      n[        U5      (       d#  U(       a  SOSn[        UR                  US95      eU	(       a8  UR                  5       (       a#  U(       a  S	OS
n[        UR                  US95      e[        UU	U
UUS9$ )a  Parse path arguments optionally containing selection parts and return (fspath, names).

Command-line arguments can point to files and/or directories, and optionally contain
parts for specific tests selection, for example:

    "pkg/tests/test_foo.py::TestClass::test_foo"

This function ensures the path exists, and returns a resolved `CollectionArgument`:

    CollectionArgument(
        path=Path("/full/path/to/pkg/tests/test_foo.py"),
        parts=["TestClass", "test_foo"],
        module_name=None,
    )

When as_pypath is True, expects that the command-line argument actually contains
module paths instead of file-system paths:

    "pkg.tests.test_foo::TestClass::test_foo[a,b]"

In which case we search sys.path for a matching module, and then return the *path* to the
found module, which may look like this:

    CollectionArgument(
        path=Path("/home/u/myvenv/lib/site-packages/pkg/tests/test_foo.py"),
        parts=["TestClass", "test_foo"],
        parametrization="[a,b]",
        module_name="pkg.tests.test_foo",
    )

If the path doesn't exist, raise UsageError.
If the path is a directory and selection parts are present, raise UsageError.
r  r  z(path cannot contain [] parametrization: Nr  z9module or package not found: {arg} (missing __init__.py?)z"file or directory not found: {arg}r  z9package argument cannot contain :: selection parts: {arg}z;directory argument cannot contain :: selection parts: {arg})rC   r  r  r  r  )		partitionr  r   r  r   r   formatr   r  )invocation_pathr  	arg_indexr  rZ   rq   squacketreststrpathr  r  r  pyarg_strpathr=  r{   s                  rk   r  r  3  s   R ==-DDjj&OGCC5IJJ-5
4&)4OK%
 $!K#G&F&!Fv  H5 	
 ,--  HN 	
 ,--'  rm   c                   UR                   U R                   :w  a7  UR                  (       d%  U R                   R                  UR                   5      $ g[        UR                  5      [        U R                  5      :  d0  U R                  S[        UR                  5       UR                  :w  a  gUR                  b  UR                  U R                  :w  a  gg)z/Check if `arg` is subsumed (contained) by `by`.FNT)rC   r  is_relative_tor   r  )r  bys     rk   "is_collection_argument_subsumed_byr    s    
 
ww#(( xx88**27733 288}s399~%?S])Crxx)O
 
%"*<*<@S@S*Srm   c                    [        U S S9n/ nSnU H+  nUb  [        XC5      (       a  M  UR                  U5        UnM-     UR                  S S9  U$ )a  Normalize collection arguments to eliminate overlapping paths and parts.

Detects when collection arguments overlap in either paths or parts and only
keeps the shorter prefix, or the earliest argument if duplicate, preserving
order. The result is prefix-free.
c                Z    U R                   U R                  U R                  =(       d    S4$ )Nr   )rC   r  r  r  s    rk   <lambda>0normalize_collection_arguments.<locals>.<lambda>  s    399c.A.A.GRHrm   )keyNc                    U R                   $ r   )r  r  s    rk   r  r    s
    C$6$6rm   )sortedr  r=   sort)r  collection_args_sorted
normalized	last_keptr  s        rk   r  r    sf     $H ,.JI%$Fs$V$Vc"I & OO6O7rm   )ri   r   ru   r  )rC   rg   ru   rg   )r   r   r   z2Callable[[Config, Session], int | ExitCode | None]ru   r;  )r   r   ru   r;  )r   r   r~   r   ru   zint | ExitCode | None)r~   r   ru   r  )r~   r   ru   r<   )rC   r	   ru   r<   )r   r	   r   r   ru   zbool | None)rC   r	   r   r4  ru   znodes.Collector | None)r   zlist[nodes.Item]r   r   ru   r  )r  rg   rZ   r<   ru   r  )r  r	   r  rg   r  rc   r  r<   rZ   r<   ru   r  )r  r  r  r  ru   r<   )r  zSequence[CollectionArgument]ru   zlist[CollectionArgument])\r  
__future__r   rv   collections.abcr   r   r   r   r   AbstractSetdataclassesr   re   rM   importlib.utilr   pathlibr	   r   typingr
   r   r   r   r_  pluggyr   r   _pytest._code_pytest.configr   r   r   r   r   r   _pytest.config.argparsingr   r   _pytest.config.compatr   _pytest.outcomesr   _pytest.pathlibr   r   r   r   r   r    _pytest.reportsr!   r"   _pytest.runnerr#   r$   _pytest.warning_typesr%   typing_extensionsr&   _pytest.fixturesr'   rl   rh   r   r   r   r   r   r   r   r   r   r  r   r   r   r   	dataclassdictrg   r  	Directoryr   r  r   r  r  r  r  r  r  rm   rk   <module>r     sX   N "  $ $ $ $ .      	  
          ! ( # # . % 7 , 4 ! ( ' & ' - # ) & + % / &/[|288L88v'
&*#L.
.'..$ # -Y - dCi   0 %// 0  0 f @<eoo @< @<H >C!(!(6:!(!(H d#  $ (-LL	L L
 L "&L L^	!3	01rm   