
    yIf              	          d Z ddlZddlZddlZddlZddlZddlZddlZddlm	Z	 ddl
Z
ddl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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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#l5m6Z6 dd$l5m7Z7 dd%l8m9Z9 dd&l8m:Z: dd'l;m<Z< erdd(lm=Z= d)e(d*dfd+Z>d,e?d*e?fd-Z@d.e!d/ee!d0geeeAe#f                  f         d*eeAe#f         fd1ZBd.e!d*eeAe#f         fd2ZCd.e!d3d0d*eeeAe#f                  fd4ZDdUd5ZEd3d0d*eFfd6ZGd,e	d*eFfd7ZHd8e	d.e!d*eeF         fd9ZId,e	d:ejJ        d*eejJ                 fd;ZKd<eejL                 d.e!d*dfd=ZM G d> d?          ZN G d@ dAeO          ZP G dB dCeQ          ZRejS         G dD dEee	e?f                               ZTe G dF dGejU                              ZVe G dH d0ejJ                              ZWdIe?d*ee?         fdJZX ejS        dKL           G dM dN                      ZYdOdPdQe	dRe?dSeFd*eYfdTZZdS )VzHCore implementation of the testing process: init, session, runtest loop.    N)Path)AbstractSet)Callable)Dict)final)	FrozenSet)Iterable)Iterator)List)Literal)Optional)overload)Sequence)Tuple)TYPE_CHECKING)Union)nodes)Config)directory_arg)ExitCode)hookimpl)PytestPluginManager)
UsageError)Parser)PathAwareHookProxy)FixtureManager)exitabsolutepath)bestrelpath
fnmatch_ex)safe_exists)scandir)CollectReport)
TestReport)collect_one_node)
SetupState)PytestWarning)Selfparserreturnc           
         |                      dddg d           |                      dddg            |                     dd	          }|                    d
ddddd           |                     d          }|                    dddd           |                      ddd           |                    dddt          ddd            |                    d!d"d#           |                    d$d"d%           |                    d&d"d'           |                    d(d)d*t
          d+d,-           |                    d.d"d/d0d12           |                    d3dd4d56           |                     d7d8          }|                    d9d:d;d"d<           |                    d=d"d>           |                    d?dd@dAB           |                    dCdd@dDB           |                    dEddFdGB           |                    dHdId dJt          j        t          dHK          dLM           |                    dNd"dOd/dPQ           |                    dRdSd"dTd/dUQ           |                    dVd"dWd/dXQ           |                    dYdZg d[d\d]^           |                      d_d`d/dab           |                     dcdd          }|                    dedfd t          dJdgh           d S )iNnorecursedirsz)Directory patterns to avoid for recursionargs)	z*.eggz.*_darcsbuildCVSdistnode_modulesvenvz{arch})typedefault	testpathszZDirectories to search for tests when no files or directories are given on the command linegeneralzRunning and selection optionsz-xz--exitfirststore_constmaxfail   z,Exit instantly on first error or failed test)actiondestconsthelpzpytest-warningsz-Wz--pythonwarningsappendz<Set which warnings to report, see -W option of Python itself)r=   r@   filterwarningslinelistz_Each line specifies a pattern for warnings.filterwarnings. Processed after -W/--pythonwarnings.)r6   r@   z	--maxfailnumstorer   z'Exit after first num failures or errors)metavarr=   r6   r>   r7   r@   z--strict-config
store_truezbAny warnings encountered while parsing the `pytest` section of the configuration file raise errorsz--strict-markerszVMarkers not registered in the `markers` section of the configuration file raise errorsz--strictz&(Deprecated) alias to --strict-markersz-cz--config-fileFILEinifilenamezcLoad configuration from `FILE` instead of trying to locate one of the implicit configuration files.)rF   r6   r>   r@   z--continue-on-collection-errorsFcontinue_on_collection_errorsz4Force test execution even if collection errors occur)r=   r7   r>   r@   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>   r@   collect
collectionz--collectonlyz--collect-onlyz--coz&Only collect tests, don't execute themz--pyargsz1Try to interpret all arguments as Python packagesz--ignorepathz-Ignore path during collection (multi-allowed))r=   rF   r@   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>   r7   rF   r6   r@   z--noconftest
noconftestz Don't load any conftest.py files)r=   r>   r7   r@   z--keepduplicatesz--keep-duplicateskeepduplicateszKeep duplicate testsz--collect-in-virtualenvcollect_in_virtualenvz2Don't ignore tests in a local virtualenv directoryz--import-modeprepend)rV   rA   	importlib
importmodez\Prepend/append to sys.path when importing test modules and conftest files. Default: prepend.)r7   choicesr>   r@   consider_namespace_packagesboolzEConsider namespace packages when resolving module names during import)r6   r7   r@   debugconfigz(test session debugging and configurationz
--basetempbasetempz^Base temporary directory for this test run. (Warning: this directory is removed if it exists.))r>   r7   r6   rF   r@   )
addinigetgroup
_addoption	addoptionintstr	functoolspartialr   validate_basetemp)r+   groups     @/var/www/piapp/venv/lib/python3.11/site-packages/_pytest/main.pypytest_addoptionri   ;   s   
MM3

 

 

	      MM	     OOI'FGGE	;     OO-..E	OOK	     MM/     
6     
*     
     
5    
 
(     
),C     
	     OOI|44E	OO5     
OO@    
 
OO<	     
OOD	     
OOS	     
OO}nEEE@     
OO/     
OO#     
OO!$A     
OO222#     MM%T	     OOM+UVVE	OOA  
 
 
 
 
    rN   c                    d}| st          j        |          dt          dt          dt          fd} |t          j                    t          |                                                     rt          j        |           |t          j                                                    t          |                                                     rt          j        |          | S )NzWbasetemp must not be empty, the current working directory or any parent directory of itbasequeryr,   c                 $    | |k    rdS || j         v S )z,Return whether query is an ancestor of base.T)parents)rl   rm   s     rh   is_ancestorz&validate_basetemp.<locals>.is_ancestor   s    5==4$$rj   )argparseArgumentTypeErrorr   r[   cwdabsoluteresolve)rN   msgrp   s      rh   rf   rf      s    
cC  .(---%$ %t % % % % % {48::tDzz224455 .(--- {48::%%''d););)=)=>> .(---Krj   configdoitSessionc           	      $   t                               |           }t          j        |_        d}	 	 |                                  d}| j                            |           d} || |          pd|_        n# t          $ r t          j	        |_         t          $ r t          j        |_        Y nt          t          j        f$ r t          j        j                                        }t          j        }t)          |j        t          j                  rR|j        j        |j        j        }|dk     r4t.          j                            |j         d|j        j         d           | j                            |           ||_        Y nt:          $ r t          j        |_        t          j        j                                        }	 |                     || j                    t)          |j        tB                    rt.          j                            d	           nf# t          j        $ rT}|j        |j        |_        t.          j                            tE          |          j#         d| d           Y d}~nd}~ww xY wY nw xY wd}tI          j%        |j&                   |dk    r	 | j        '                    ||j        
           nf# t          j        $ rT}|j        |j        |_        t.          j                            tE          |          j#         d| d           Y d}~nd}~ww xY w| (                                 n# d}tI          j%        |j&                   |dk    r	 | j        '                    ||j        
           nf# t          j        $ rT}|j        |j        |_        t.          j                            tE          |          j#         d| d           Y d}~nd}~ww xY w| (                                 w xY w|j        S )zSkeleton command line program.r   r<   session   Nz: 
)excinfoz(mainloop: caught unexpected SystemExit!
)r|   
exitstatus))ry   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typenamerv   pytest_keyboard_interruptBaseExceptionINTERNAL_ERRORnotify_exceptionoption
SystemExitr6   __name__oschdir	startpathpytest_sessionfinish_ensure_unconfigure)rw   rx   r|   	initstater   r   excs          rh   wrap_sessionr     sc    !!&))G!GI0% 	R  """IK++G+<<<I!%fg!6!6!;!G 	 	 	!)!5G 	7 	7 	7!)!6G!4>2 		, 		, 		,m1>>@@G/7/CJ'-88 S=+7!(!9Jq==J$$(8%Q%QGM<M%Q%Q%QRRRK11'1BBB!+G 	R 	R 	R!)!8Gm1>>@@GR''??? gmZ88 RJ$$%PQQQ > C C C>-),G&
  DII$6!A!A#!A!A!ABBBBBBBBC	R 
"###>>C00#0B 1     > C C C>-),G&
  DII$6!A!A#!A!A!ABBBBBBBBC 	""$$$$ 
"###>>C00#0B 1     > C C C>-),G&
  DII$6!A!A#!A!A!ABBBBBBBBC 	""$$$$s   AA8 6M 86J.M 1CJM 
=JH#:JJ ,A
I;6J;J  JM JM +!K L0A
L++L0"P+!NPO0A
O+&P+O00Pc                 ,    t          | t                    S N)r   _mainrw   s    rh   pytest_cmdline_mainr   K  s    &&&rj   r|   c                     | j                             |           | j                             |           |j        rt          j        S |j        dk    rt          j        S dS )z[Default command line protocol for initialization, session,
    running tests and reporting.r{   r   N)r   pytest_collectionpytest_runtestlooptestsfailedr   r   testscollectedNO_TESTS_COLLECTED)rw   r|   s     rh   r   r   O  sf     K!!'!222
K""7"333 +$$		1	$	$**4rj   c                 .    |                                   d S r   )perform_collectr{   s    rh   r   r   \  s    rj   c                    | j         r=| j        j        j        s,|                     d| j         | j         dk    rdndfz            | j        j        j        rdS t          | j                  D ]\  }}|dz   t          | j                  k     r| j        |dz            nd }|j        j	        
                    ||           | j        r|                     | j                  | j        r|                     | j                  dS )Nz%d error%s during collectionr<   s T)itemnextitem)r   rw   r   rJ   Interruptedcollectonly	enumerateitemslenr   pytest_runtest_protocol
shouldfailr   
shouldstop)r|   ir   r   s       rh   r   r   `  s$    
7>#8#V 
!!*"7+>!+C+CCCLM
 
 	

 ~( tW]++ : :4+,q53w}3E3E+E+E7=Q''400dX0NNN 	5..!3444 	:%%g&8999	:4rj   c                     |                      t          j                            d          rdnd          }	 |                                sdS n# t
          $ r Y dS w xY wdt          fd|                                D                       S )zAttempt to detect if ``path`` is the root of a Virtual Environment by
    checking for the existence of the appropriate activate script.winScriptsbinF)activatezactivate.cshzactivate.fishActivatezActivate.batzActivate.ps1c              3   *   K   | ]}|j         v V  d S r   name).0fname	activatess     rh   	<genexpr>z_in_venv.<locals>.<genexpr>  s*      EE5uzY&EEEEEErj   )joinpathr   platform
startswithis_dirOSErroranyiterdir)rN   bindirr   s     @rh   _in_venvr   t  s     ]](?(?(F(FQ99ERRF}} 	5	   uuI EEEEFNN4D4DEEEEEEs   A 
AAcollection_pathc                      j         dk    rdS |                    d j                  }|pg }|                    d          }|r|                    d |D                         |v rdS |                    d j                  }|pg }|                    d          }|r|                    d	 |D                        t           fd
|D                       rdS |                    d          }|st                     rdS                                  r2|                    d          }t           fd|D                       rdS d S )N__pycache__Tcollect_ignorerN   ignorec              3   4   K   | ]}t          |          V  d S r   r   r   xs     rh   r   z(pytest_ignore_collect.<locals>.<genexpr>  s(      @@LOO@@@@@@rj   collect_ignore_globignore_globc              3   4   K   | ]}t          |          V  d S r   r   r   s     rh   r   z(pytest_ignore_collect.<locals>.<genexpr>  s(      DDLOODDDDDDrj   c              3   v   K   | ]3}t          j         t                    t          |                    V  4d S r   )fnmatchrc   )r   globr   s     rh   r   z(pytest_ignore_collect.<locals>.<genexpr>  s=      
U
U7?3//T;;
U
U
U
U
U
Urj   rU   r.   c              3   8   K   | ]}t          |          V  d S r   r!   )r   patr   s     rh   r   z(pytest_ignore_collect.<locals>.<genexpr>  s-      MMCz#//MMMMMMrj   )	r   _getconftest_pathlistparent	getoptionextendr   r   r   getini)r   rw   ignore_paths
excludeoptignore_globsexcludegloboptallow_in_venvnorecursepatternss   `       rh   pytest_ignore_collectr     s   },,t//5 0  L  %2L!!(++J A@@Z@@@@@@,&&t//O$: 0  L  %2L%%m44N EDD^DDDDDD

U
U
U
U
U
U
UUU t$$%<==M Xo66 t "MM/::MMMM;LMMMMM 	44rj   r   c                 :    t                               ||           S )Nr   )Dirfrom_parentrN   r   s     rh   pytest_collect_directoryr     s     ??6?---rj   r   c                 >   t          |                    d          pg           }|sd S g }g }| D ]G}|j                            |          r|                    |           2|                    |           H|r$|j                            |           || d d <   d S d S )Ndeselect)r   )tupler   nodeidr   rA   r   pytest_deselected)r   rw   deselect_prefixes	remaining
deselectedcolitems         rh   pytest_collection_modifyitemsr    s    f..z::@bAA IJ & &>$$%677 	&g&&&&W%%%% %%J%777aaa rj   c                   H    e Zd Zdedee         ddfdZdedej	        fdZ
dS )FSHookProxypmremove_modsr,   Nc                 "    || _         || _        d S r   )r  r  )selfr  r  s      rh   __init__zFSHookProxy.__init__  s    
 &rj   r   c                 \    | j                             || j                  }|| j        |<   |S )N)remove_plugins)r  subset_hook_callerr  __dict__)r  r   r   s      rh   __getattr__zFSHookProxy.__getattr__  s0    G&&tD<L&MMdrj   )r   
__module____qualname__r   r   objectr	  rc   pluggy
HookCallerr   rj   rh   r  r    sn        '' !(' 
	' ' ' ' (9      rj   r  c                       e Zd ZdZdZdS )r   z*Signals that the test run was interrupted.builtinsNr   r  r  __doc__r  rj   rh   r   r     s        44JJJrj   r   c                       e Zd ZdZdS )r   z"Signals a stop as failed test run.Nr  r  rj   rh   r   r     s        ,,,,rj   r   c                   .    e Zd ZU dZeed<   dedefdZdS )_bestrelpath_cacher   rN   r,   c                 :    t          | j        |          }|| |<   |S r   )r    rN   )r  rN   rs      rh   __missing__z_bestrelpath_cache.__missing__  s!    	4((T
rj   N)r   r  r  	__slots__r   __annotations__rc   r  r  rj   rh   r  r    sF         I
JJJ       rj   r  c                        e Zd ZdZedej        deddf fd            Zde	e
ej        ej        f                  fdZ xZS )r   a  Collector 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.
    r   rN   r,   r*   c                J    t                                          ||          S )zThe public constructor.

        :param parent: The parent collector of this Dir.
        :param path: The directory's path.
        )r   rN   )superr   )clsr   rN   	__class__s      rh   r   zDir.from_parent  s"     ww""&t"<<<rj   c              #   :  K   | j         }| j        }t          | j                  D ]}|                                rft          |j                  }| j                            |d          s|                    ||          r^|	                    ||           }||V  ||
                                ret          |j                  }| j                            |          s|                    ||          r|                    ||           }|E d {V  d S )NTwith_parents)r   rw   r   	file_pathr   )rw   ihookr$   rN   r   r   r|   
isinitpathr   r   is_filepytest_collect_file)r  rw   r+  direntryrN   colcolss          rh   rL   zDir.collect  sA      
	** 	  	 H    HM**|..t$.GG !224PV2WW ! 44$t4LL?III!!##  HM**|..t44 !224PV2WW ! 0040MM!	  	 rj   )r   r  r  r  classmethodr   	Collectorr   r   r	   r   ItemrL   __classcell__r%  s   @rh   r   r     s        	 	 == 	=
 
= = = = = [= %
EO(C"DE                rj   r   c                   n    e Zd ZU dZeZeZeed<   eed<   e	e
ef         ed<   deddf fdZededd fd	            Zdefd
Zede	eef         fd            Zej        de	eef         ddfd            Zede	eef         fd            Zej        de	eef         ddfd            Zedefd            ZdedefdZ ed          d.d            Z ed          de	eef         ddfd            ZeZddde	edf         dedefdZ ddde!j"        fdZ#ded e$ee%e&j'                 f         de%e&j'                 fd!Z(e)	 d/d#e*e%e                  d$d%de%e&j+                 fd&            Z,e)	 d/d#e*e%e                  d$ede%e	e&j+        e&j'        f                  fd'            Z,	 d0d#e*e%e                  d$ede%e	e&j+        e&j'        f                  fd(Z,	 d1d)e&j'        d*ede-eef         fd+Z.de/e	e&j+        e&j'        f                  fd,Z0d)e	e&j+        e&j'        f         de/e&j+                 fd-Z1 xZ2S )2ry   zoThe root of the collection tree.

    ``Session`` collects the initial paths given as arguments to pytest.
    _setupstate_fixturemanagerr   rw   r,   Nc           	         t                                          d|j        d d || d           d| _        d| _        d| _        d| _        |j        j        	                    d          | _        t                      | _        t                      | _        g | _        g | _        i | _        g | _        t#          |j                  | _        | j        j                            | d           d S )Nr   )r   rN   fspathr   rw   r|   r   r   FrM   r|   r   )r#  r	  rootpathr   r   _shouldstop_shouldfailtracerootget	frozenset_initialpaths_initialpaths_with_parents	_notfound_initial_parts_collection_cacher   r  _bestrelpathcacherw   pluginmanagerregister)r  rw   r%  s     rh   r	  zSession.__init__-  s     	 	
 	
 	
 -2-2\&**<88
.7kk;D;;'FH8:GI')
2DV_2U2U!**4i*@@@@@rj   c                 2    |                      |          }|S )Nr   )_create)r$  rw   r|   s      rh   r   zSession.from_configG  s    ;;f;55rj   c                 f    d| j         j        | j        t          | dd          | j        | j        fz  S )Nz6<%s %s exitstatus=%r testsfailed=%d testscollected=%d>r   z<UNSET>)r%  r   r   getattrr   r   r  s    rh   __repr__zSession.__repr__L  s=    GN#ID,	22K
 
 	
rj   c                     | j         S r   )r=  rO  s    rh   r   zSession.shouldstopU      rj   r   c                 t    |du r,| j         r%t          j        t          d          d           d S || _         d S )NFzCsession.shouldstop cannot be unset after it has been set; ignoring.r}   
stacklevel)r=  warningswarnr)   r  r   s     rh   r   zSession.shouldstopY  W     E>>d.>MY  	    F rj   c                     | j         S r   )r>  rO  s    rh   r   zSession.shouldfailg  rR  rj   c                 t    |du r,| j         r%t          j        t          d          d           d S || _         d S )NFzCsession.shouldfail cannot be unset after it has been set; ignoring.r}   rT  )r>  rV  rW  r)   rX  s     rh   r   zSession.shouldfailk  rY  rj   c                 $    | j         j        j        S )zQThe path from which pytest was invoked.

        .. versionadded:: 7.0.0
        )rw   invocation_paramsrQ   rO  s    rh   r   zSession.startpathy  s     {,00rj   	node_pathc                     | j         |         S r   )rH  )r  r^  s     rh   _node_location_to_relpathz!Session._node_location_to_relpath  s    %i00rj   T)tryfirstc                     | j         r|                     | j                   | j        r|                     | j                  d S r   )r   r   r   r   rO  s    rh   pytest_collectstartzSession.pytest_collectstart  sJ    ? 	/++do...? 	4""4?333	4 	4rj   reportc                     |j         rXt          |d          sJ| xj        dz  c_        | j                            d          }|r | j        |k    rd| j        z  | _        d S d S d S d S d S )Nwasxfailr<   r;   zstopping after %d failures)failedhasattrr   rw   getvaluer   )r  rd  r;   s      rh   pytest_runtest_logreportz Session.pytest_runtest_logreport  s     = 	T!<!< 	T!k**955G T4+w66">$BR"S		T 	T 	T 	TT T66rj   Fr'  rN   zos.PathLike[str]r(  c                v    t          |t                    r|nt          |          }|r	|| j        v S || j        v S )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   rD  rC  )r  rN   r(  path_s       rh   r,  zSession.isinitpath  sF    $ #4..>DJJ 	/D;;;D...rj   r;  c                     t          |t                    r|nt          |          }| j        j        }|                    |          }|j                            |          }|rt          t          ||                    }n| j        j	        }|S r   )
r   r   rw   rI  _getconftestmodules_conftest_plugins
differencer   r  r   )r  r;  rN   r  my_conftestmodulesr  proxys          rh   gethookproxyzSession.gethookproxy  s    #FD11CvvtF||[&  33D99*556HII 	%&{2{'C'CDDEE K$Erj   
path_cachec                 H   ||v r||         S |                                 r9|                     |j                  }|                    ||           }||fnd}nC|                                r-|                     |          }|                    ||           }nd}|||<   |S )zCreate a Collector for the given path.

        `path_cache` makes it so the same Collectors are returned for the same
        path.
        r   Nr  r)  )r   rs  r   r   r-  r.  )r  rN   rt  r+  r0  r1  s         rh   _collect_pathzSession._collect_path  s     :d##;;== 	%%dk22E-2-K-K$ .L . .C 9<sffRDD\\^^ 	%%d++E,,tD,IIDD D
4rj   .r/   genitemszLiteral[True]c                     d S r   r  r  r/   rw  s      rh   r   zSession.perform_collect  s	      #srj   c                     d S r   r  ry  s      rh   r   zSession.perform_collect  s	     8;srj   c                    || j         j        }|                     d| |           | j        j        xj        dz  c_        | j         j        }g | _        g | _        i | _        g | _	        | j	        }	 g }g }|D ]}t          | j         j        j        || j         j        j                  }| j                            |           |                    |j                   |                    |j                   |                    |j        j                   t'          |          | _        t'          |          | _        t-          |           }	| j                            |	           | j        j        xj        dz  c_        | j        rOg }
| j        D ]<\  }}|r|
                    d| d|d           $|
                    d	|            =t3          |
 |s|	j        }n>|	j        r7|	j        D ]/}| j	                            |                     |                     0| j         j                                         |                    | | j         |
           g | _        g | _        i | _        |                     |            n0# g | _        g | _        i | _        |                     |            w xY w|rtC          |          | _"        |S )a  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.
        Nr   r<   	as_pypathrd  znot found: z
(no match in any of )zfound no collectors for )r|   rw   r   r{   )#rw   r/   r?  r@  indentr   rE  rF  rG  r   resolve_collection_argumentr]  rQ   r   pyargsrA   rN   r   ro   rB  rC  rD  r'   r+  pytest_collectreportr   resultpassedrw  rI  check_pendingr  pytest_collection_finishr   r   )r  r/   rw  r   r   initialpathsinitialpaths_with_parentsargcollection_argumentreperrors
collectorsnodes                rh   r   zSession.perform_collect  s%     <;#D

$dD111
!#{ !#
>Bj.	8')L46% 	S 	S&AK15"k07' ' '#
 #**+>???##$7$<===)001D1IJJJ)001D1I1QRRRR!*<!8!8D.78Q.R.RD+"4((CJ++3+777JO""a'""~ 
*'+~ H HOC! HT#TTZTTT    &F&F&FGGGG &)) ?
: ? #
 ? ?
))$--*=*=>>>>K%33555..T[ /     DN"$D%'D"))$)7777  DN"$D%'D"))$)7777 	-"%e**Ds   0G+J -J4r  handle_dupesc                 t    || j         v r|r| j         |         }|dfS t          |          }|| j         |<   |dfS )NTF)rG  r'   )r  r  r  r  s       rh   _collect_one_nodezSession._collect_one_node<  sR    
 4)))l)(.C9"4((C+.D"4(:rj   c              #     K   i }| j         j        }| j        D ]}|                     d|           | j        j        xj        dz  c_        |j        }|j        }|j        }|	                                r|rJ d||f            |g}|8|j
        D ]/}|                    |          s n|                    d|           0nm|                    d          }	t          |j
        d          D ]B\  }
}|
t          |	          k    s|j        |	|
          k    r n|                    d|           Cd}g }| g ||fg}|re|                                \  }}|s|V  d}#t%          |t&          j                  s>t%          |t*                    r:t%          |d         t,                    sJ |                    |d         |          }nt          |          dk    o4t%          |d         t,                    o|d                                          }|                     ||          \  }}|s"|j        s|j                            |	           |j        s|j        }d}t=          |          D ]}t%          |d         t,                    r|j        |d         k    }t>          j         d
k    rz|sxtB          j        "                    |j        |d                   }|oJtB          j        #                    |j                  tB          j        #                    |d                   k    }n;|j$        |d         k    p)|j$                            d          d         |d         k    }|r!|%                    ||dd          f           d}|s|%                    |           |e|sBd&                    tO          |          g|R           }| j(        %                    ||f           | j        j        xj        dz  c_        d S )Nzprocessing argumentr<   zinvalid arg r   .r}   FTr~  win32[::))rw   rI  rF  r?  r@  r  rN   partsmodule_namer   ro   _is_in_confcutdirinsertsplitr   r   stempopr   r   r3  ry   r   rv  r-  r  r  r+  r  r  reversedr   r   r   samefileislinkr   rA   joinrc   rE  )r  rt  r  r  argpathnamesr  pathsrN   module_name_partsr   any_matched_in_initial_partnotfound_collectorswork	matchnode
matchpartssubnodesr  r  	duplicateany_matched_in_collectorr  is_match	same_file
report_args                            rh   rL   zSession.collectI  s      =?
[&#'#6 o	( o	(JJ,.ABBBJO""a'"").G'-E-9K ~~ F EE"E'51A"E"EEEEIE "#O * *D//55 LLD)))) %0$5$5c$:$:!(!<< * *GAt301111TYBSUVTVBW5W5WLLD)))) +0'"$ (%(%()*   D:(,

%	: " #OOO26/ ")U_==  i11 *%jmT:::::(66z!}jQQHH
 J1, 4&z!}d;;4&qM1133$L
 &*%;%;I|%T%TNC$ ISZ I "<<C<HHH: ! "zH ,1($X.. 8 8D!*Q-66 #'9
1#=<72282 )+(8(8JqM(R(RI (1 ( "ty 9 9#%7>>*Q-#@#@!A % !IA6 H#ys33A6*Q-G !   8T:abb>$:;;;370/ :'..y999I  D:L / I!YYG'=u'='=>>
%%z3F&GHHHJO""a'"""_o	( o	(rj   c              #   &  K   |                      d|           t          |t          j                  r!|j                            |           |V  d S t          |t          j                  sJ | j                            d          }|ot          |t          j	                   }| 
                    ||          \  }}|r|sd S |j        r%|j        D ]}|                     |          E d {V  |s|j                            |           d S d S )Nrw  )r   rT   r~  )r?  r   r   r4  r+  pytest_itemcollectedr3  rw   r   Filer  r  r  rw  r  )r  r  rT   r  r  r  subnodes          rh   rw  zSession.genitems  s=      	

:t$$$dEJ'' 	<J+++666JJJJJdEO44444![223CDDN . O:dEJ3O3OPL!33D,GGNC  z 6"z 6 6G#}}W5555555555 <
//s/;;;;;< <rj   )r,   N)..)NT)T)3r   r  r  r  r   r   r(   r   r   r   rb   r   r   r	  r2  r   rc   rP  propertyr[   r   setterr   r   r   r`  r   rc  r&   r%   rj  r  r,  r  	HookRelayrs  r   r   r   r3  rv  r   r   r4  r   r   r  r
   rL   rw  r5  r6  s   @rh   ry   ry     s         
 KF####c8m$$$$Av A$ A A A A A A4  I    [
# 
 
 
 
  E$),       X  !dCi 0 !T ! ! ! !  E$),       X  !dCi 0 !T ! ! ! ! 14 1 1 1 X114 1C 1 1 1 1 Xt4 4 4 4 XtTJ56T	T T T T 4 #	/ / /C++,/ 	/
 
/ / / /0#5 &:J    " x889 
%/	"	   > OR# #Xc]+#=L#	%*	# # # X# DG; ;Xc]+;=A;	%
EO34	5; ; ; X;
 FJP PXc]+P>BP	%
EO34	5P P P Pj " o  
}d"	#	   w(%
EO(C"DE w( w( w( w(r<%*eo56<	%*	< < < < < < < <rj   r  c                    	 t           j                            |           }n# t          t          t
          f$ r Y dS w xY w||j        |j        dk    rdS |j        r$t          j	        
                    |j                  S |j        S )zaSearch sys.path for the given a dotted module name, and return its file
    system path if found.N	namespace)rW   util	find_specAttributeErrorImportError
ValueErrororiginsubmodule_search_locationsr   rN   dirname)r  specs     rh   search_pypathr    s    ~''44 K4   tt|t{*dk[.H.Ht		( wt{+++{s   " ==T)frozenc                   J    e Zd ZU dZeed<   ee         ed<   ee         ed<   dS )CollectionArgumentzA resolved collection argument.rN   r  r  N)	r   r  r  r  r   r   r   rc   r   r  rj   rh   r  r    sA         ))
JJJC=#rj   r  Fr|  invocation_pathr  r}  c                   t          |                              d          \  }}}|                    d          ^}}|r|d          | | |d<   d}|rt          |          }	|	|}|	}| |z  }
t	          |
          }
t          |
          s)|rdnd}t          |                    |                    |r=|
                                r)|rdnd	}t          |                    |                    t          |
||
          S )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"

    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"],
            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  Nz9module 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})rN   r  r  )
rc   	partitionr  r  r   r#   r   formatr   r  )r  r  r}  rl   squacketreststrpathr  r  pyarg_strpathr;  rv   s               rh   r  r    sT   F s88--c22D(Djj&&OGe 3Ry2(2D22b	K $%g..$!K#Gw&F&!!Fv . 6GG5 	
 ,,--- . . OGGN 	
 ,,---   rj   )r|   ry   r,   N)[r  rq   dataclassesr   rd   rW   importlib.utilr   pathlibr   r   typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   rV  r  r   r   _pytest._code_pytest.configr   r   r   r   r   r   _pytest.config.argparsingr   _pytest.config.compatr   _pytest.fixturesr   _pytest.outcomesr   _pytest.pathlibr   r    r"   r#   r$   _pytest.reportsr%   r&   _pytest.runnerr'   r(   _pytest.warning_typesr)   r*   ri   rc   rf   rb   r   r   r   r   r[   r   r   r   r3  r   r4  r  r  r   r   r   r   	dataclassr  	Directoryr   ry   r  r  r  r  rj   rh   <module>r     s"   N N                   				       



                                                                                                             ! ! ! ! ! ! ( ( ( ( ( ( # # # # # # # # # # # # . . . . . . % % % % % % , , , , , , 4 4 4 4 4 4 + + + + + + ! ! ! ! ! ! ( ( ( ( ( ( ' ' ' ' ' ' & & & & & & ' ' ' ' ' ' # # # # # # ) ) ) ) ) ) & & & & & & + + + + + + % % % % % % / / / / / /  yV y y y y yxC C    288"FI#6sH}AU8V#VW8
3=8 8 8 8v' '5h+? ' ' ' '
& 
9 
%X:N1O 
 
 
 
   	 d    (F4 FD F F F F(#4 # #HTN # # # #L.
..eo. . . .ej)9 6 d    $           #   - - - - -Y - - -     dCi    /  /  /  /  / %/ /  /  / d v< v< v< v< v<eo v< v< v<rs x}    $ d###       $# ;@A A AA #A37AA A A A A Arj   