o
    Ú­j’  ã                   @   sŠ  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
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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*m.Z. dd l*m/Z/ dd!l0m1Z1 dd"l0m2Z2 dd#l3m4Z4 dd$l3m5Z5 erödd%l6m7Z7 d&e%d'dfd(d)„Z8d*e9d'e9fd+d,„Z:d-ed.eed/geee;e f  f d'ee;e f fd0d1„Z<d-ed'ee;e f fd2d3„Z=d-ed4d/d'eee;e f  fd5d6„Z>dVd7d8„Z?d4d/d'e@fd9d:„ZAd*e	d'e@fd;d<„ZBd=e	d-ed'ee@ fd>d?„ZCd@eejD d-ed'dfdAdB„ZEG dCdD„ dDƒZFG dEdF„ dFeGƒZHG dGdH„ dHeIƒZJejKG dIdJ„ dJee	e9f ƒƒZLeG dKd/„ d/ejMƒƒZNdLe9d'e9fdMdN„ZOdOdPœdQe	dRe9dSe@d'ee	ee9 f fdTdU„ZPdS )WzHCore implementation of the testing process: init, session, runtest loop.é    N)ÚPath)ÚCallable)ÚDict)Ú	FrozenSet)ÚIterator)ÚList)ÚOptional)ÚSequence)ÚSet)ÚTuple)ÚType)ÚTYPE_CHECKING)ÚUnion)Únodes)Úfinal)Úoverload)ÚConfig)Údirectory_arg)ÚExitCode)Úhookimpl)ÚPytestPluginManager)Ú
UsageError)ÚParser)ÚFixtureManager)Úexit©Úabsolutepath)Úbestrelpath©Ú
fnmatch_ex)Úsafe_exists)Úvisit)ÚCollectReport)Ú
TestReport)Úcollect_one_node)Ú
SetupState)ÚLiteralÚparserÚreturnc              	   C   sü  | j dddg d¢d� | j dddg d� |  dd	¡}|jd
dddddd� |  d¡}|jddddd� | j dddd� |jdddtdddd � |jd!d"d#d� |jd$d"d%d� |jd&d"d'd� |jd(d)d*td+d,d-� |jd.d"d/d0d1d2� |jd3dd4d5d6� |  d7d8¡}|jd9d:d;d"d<d� |jd=d"d>d� |jd?dd@dAdB� |jdCdd@dDdB� |jdEddFdGdB� |jdHdId dJtjtdHdK�dLdM� |jdNd"dOd/dPdQ� |jdRdSd"dTd/dUdQ� |jdVd"dWd/dXdQ� |jdYdZg d[¢d\d]d^� |  d_d`¡}|jdadbd t	dJdcdd� d S )eNÚ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)r8   r;   ÚfilterwarningsÚlinelistz_Each line specifies a pattern for warnings.filterwarnings. Processed after -W/--pythonwarnings.)r1   r;   z	--maxfailÚnumÚstorer   z'Exit after first num failures or errors)Úmetavarr8   r1   r9   r2   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.)rA   r1   r9   r;   z--continue-on-collection-errorsFÚcontinue_on_collection_errorsz4Force test execution even if collection errors occur)r8   r2   r9   r;   z	--rootdirÚrootdirz¶Define 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'.)r8   r9   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))r8   rA   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)r9   r2   rA   r1   r;   z--noconftestÚ
noconftestz Don't load any conftest.py files)r8   r9   r2   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)rQ   r<   Ú	importlibÚ
importmodez\Prepend/append to sys.path when importing test modules and conftest files. Default: prepend.)r2   Úchoicesr9   r;   Údebugconfigz(test session debugging and configurationz
--basetempÚbasetempz^Base temporary directory for this test run. (Warning: this directory is removed if it exists.))r9   r2   r1   rA   r;   )
ÚaddiniÚgetgroupÚ
_addoptionÚ	addoptionÚintÚstrÚ	functoolsÚpartialr   Úvalidate_basetemp)r'   Úgroup© ra   úI/var/www/html/CropPilot/venv/lib/python3.10/site-packages/_pytest/main.pyÚpytest_addoption3   s6  üûú
üýù	ýýýú	ûü	ûýüüüúûúûû	
ùrc   rI   c                 C   sp   d}| s	t  |¡‚dtdtdtfdd„}|t ¡ t| ƒ ¡ ƒr$t  |¡‚|t ¡  ¡ t| ƒ ¡ ƒr6t  |¡‚| S )NzWbasetemp must not be empty, the current working directory or any parent directory of itÚbaseÚqueryr(   c                 S   s   | |krdS || j v S )z,Return whether query is an ancestor of base.T)Úparents)rd   re   ra   ra   rb   Úis_ancestorñ   s   
z&validate_basetemp.<locals>.is_ancestor)ÚargparseÚArgumentTypeErrorr   ÚboolÚcwdÚabsoluteÚresolve)rI   Úmsgrg   ra   ra   rb   r_   é   s   


r_   ÚconfigÚdoitÚSessionc                 C   sÚ  t  | ¡}tj|_d}�zz|  ¡  d}| jj|d� d}|| |ƒp#d|_W n­ ty2   tj	|_‚  t
y>   tj|_Y n– ttjfy€   tjj ¡ }tj}t|jtjƒrt|jjdura|jj}|dk rttj |j› d|jj› d�¡ | jj|d� ||_Y nT tyÓ   tj|_tjj ¡ }z	|  || j ¡ W n+ tjyÄ } z|jdur«|j|_tj t!|ƒj"› d|› d�¡ W Y d}~nd}~ww t|jt#ƒrÑtj d	¡ Y nw W d}t$ %|j&¡ |dk�rz| jj'||jd
� W n- tj�y } z|jdu�r|j|_tj t!|ƒj"› d|› d�¡ W Y d}~nd}~ww |  (¡  |jS d}t$ %|j&¡ |dk�rhz| jj'||jd
� W n- tj�yg } z|jdu�rN|j|_tj t!|ƒj"› d|› d�¡ W Y d}~nd}~ww |  (¡  w )zSkeleton command line program.r   r7   ©Úsessioné   Nz: Ú
)Úexcinfoz(mainloop: caught unexpected SystemExit!
)rs   Ú
exitstatus))rq   Úfrom_configr   ÚOKrw   Ú_do_configureÚhookÚpytest_sessionstartr   ÚUSAGE_ERRORÚFailedÚTESTS_FAILEDÚKeyboardInterruptr   Ú	ExceptionÚ_pytestÚ_codeÚExceptionInfoÚfrom_currentÚINTERRUPTEDÚ
isinstanceÚvalueÚ
returncodeÚsysÚstderrÚwriteÚtypenamern   Úpytest_keyboard_interruptÚBaseExceptionÚINTERNAL_ERRORÚnotify_exceptionÚoptionr1   Ú__name__Ú
SystemExitÚosÚchdirÚ	startpathÚpytest_sessionfinishÚ_ensure_unconfigure)ro   rp   rs   Ú	initstaterv   rw   Úexcra   ra   rb   Úwrap_session  sŒ   


*€ý€õ€

ÿ*€ýô

ÿ*€ý
rœ   c                 C   s
   t | tƒS ©N)rœ   Ú_main©ro   ra   ra   rb   Úpytest_cmdline_main=  s   
r    rs   c                 C   s<   | j j|d� | j j|d� |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.rr   r   N)r{   Úpytest_collectionÚpytest_runtestloopÚtestsfailedr   r   ÚtestscollectedÚNO_TESTS_COLLECTED)ro   rs   ra   ra   rb   rž   A  s   
rž   c                 C   s   |   ¡  d S r�   )Úperform_collectrr   ra   ra   rb   r¡   N  s   r¡   c                 C   s¸   | j r| jjjs|  d| j | j dkrdf ¡‚df ¡‚| jjjr#dS t| jƒD ]1\}}|d t| jƒk r<| j|d  nd }|jj	j
||d� | jrP|  | j¡‚| jrY|  | j¡‚q(dS )Nz%d error%s during collectionr7   ÚsÚ T)ÚitemÚnextitem)r£   ro   r’   rE   ÚInterruptedÚcollectonlyÚ	enumerateÚitemsÚlenr{   Úpytest_runtest_protocolÚ
shouldfailr~   Ú
shouldstop)rs   Úir©   rª   ra   ra   rb   r¢   R  s(   ÿÿÿÿ
$ÿr¢   c                    s`   |   tj d¡r
dnd¡}z	| ¡ sW dS W n
 ty    Y dS w d‰ t‡ fdd„| ¡ D ƒƒS )zˆAttempt 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   s   � | ]}|j ˆ v V  qd S r�   ©Úname)Ú.0Úfname©Ú	activatesra   rb   Ú	<genexpr>w  ó   € z_in_venv.<locals>.<genexpr>)ÚjoinpathrŠ   ÚplatformÚ
startswithÚis_dirÚOSErrorÚanyÚiterdir)rI   Úbindirra   r½   rb   Ú_in_venvf  s   ÿÿrÉ   Úcollection_pathc                    sì   |j dˆ j|jd�}|pg }| d¡}|r| dd„ |D ƒ¡ ˆ |v r%dS |j dˆ j|jd�}|p2g }| d¡}|rD| d	d„ |D ƒ¡ t‡ fd
d„|D ƒƒrQdS | d¡}|s^tˆ ƒr^dS ˆ  ¡ rt| d¡}t‡ fdd„|D ƒƒrtdS d S )NÚcollect_ignore)rI   ÚrootpathÚignorec                 s   ó   � | ]}t |ƒV  qd S r�   r   ©r»   Úxra   ra   rb   r¿   �  ó   € z(pytest_ignore_collect.<locals>.<genexpr>TÚcollect_ignore_globÚignore_globc                 s   rÎ   r�   r   rÏ   ra   ra   rb   r¿   Œ  rÑ   c                 3   s$   � | ]}t   tˆ ƒt|ƒ¡V  qd S r�   )Úfnmatchr\   )r»   Úglob©rÊ   ra   rb   r¿   Ž  s   €" rP   r)   c                 3   s   � | ]}t |ˆ ƒV  qd S r�   r   )r»   ÚpatrÖ   ra   rb   r¿   —  rÀ   )	Ú_getconftest_pathlistÚparentrÌ   Ú	getoptionÚextendrÆ   rÉ   rÄ   Úgetini)rÊ   ro   Úignore_pathsÚ
excludeoptÚignore_globsÚexcludegloboptÚallow_in_venvÚnorecursepatternsra   rÖ   rb   Úpytest_ignore_collectz  s4   
ÿ

ÿ


rã   r®   c                 C   st   t | d¡pg ƒ}|sd S g }g }| D ]}|j |¡r!| |¡ q| |¡ q|r8|jj|d� || d d …< d S d S )NÚdeselect)r®   )ÚtuplerÚ   ÚnodeidrÃ   r<   r{   Úpytest_deselected)r®   ro   Údeselect_prefixesÚ	remainingÚ
deselectedÚcolitemra   ra   rb   Úpytest_collection_modifyitems�  s   þrì   c                   @   s,   e Zd Zdeddfdd„Zdefdd„ZdS )	ÚFSHookProxyÚpmr(   Nc                 C   s   || _ || _d S r�   )rî   Úremove_mods)Úselfrî   rï   ra   ra   rb   Ú__init__°  s   
zFSHookProxy.__init__rº   c                 C   s    | j j|| jd�}|| j|< |S )N)Úremove_plugins)rî   Úsubset_hook_callerrï   Ú__dict__)rð   rº   rÐ   ra   ra   rb   Ú__getattr__´  s   
zFSHookProxy.__getattr__)r“   Ú
__module__Ú__qualname__r   rñ   r\   rõ   ra   ra   ra   rb   rí   ¯  s    rí   c                   @   s   e Zd ZdZdZdS )r«   z*Signals that the test run was interrupted.ÚbuiltinsN©r“   rö   r÷   Ú__doc__ra   ra   ra   rb   r«   º  s    r«   c                   @   s   e Zd ZdZdS )r~   z"Signals a stop as failed test run.Nrù   ra   ra   ra   rb   r~   À  s    r~   c                   @   s,   e Zd ZU dZeed< dedefdd„ZdS )Ú_bestrelpath_cache)rI   rI   r(   c                 C   s   t | j|ƒ}|| |< |S r�   )r   rI   )rð   rI   Úrra   ra   rb   Ú__missing__Ê  s   z_bestrelpath_cache.__missing__N)r“   rö   r÷   Ú	__slots__r   Ú__annotations__r\   rý   ra   ra   ra   rb   rû   Ä  s   
 rû   c                       s  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d	„Zededd fd
d„ƒZdefdd„Zedefdd„ƒZdedefdd„Zedd�d5dd„ƒZedd�de	eef ddfdd„ƒZeZde	edf defdd„Zd6dd „Zd!d"defd#d$„Z	d7ded%ede e!j" fd&d'„Z#e$	(d8d)e%e e  d*d+de e!j& fd,d-„ƒZ'e$	(d8d)e%e e  d*ede e	e!j&e!j"f  fd.d-„ƒZ'	d9d)e%e e  d*ede e	e!j&e!j"f  fd/d-„Z'de(e	e!j&e!j"f  fd0d1„Z)d2e	e!j&e!j"f de(e!j& fd3d4„Z*‡  Z+S ):rq   zoThe root of the collection tree.

    ``Session`` collects the initial paths given as arguments to pytest.
    Ú_setupstateÚ_fixturemanagerrw   ro   r(   Nc                    sl   t ƒ j|jd d || dd� d| _d| _d| _d| _|jj 	d¡| _t
ƒ | _t|jƒ| _| jjj| dd� d S )Nr¨   )rI   ÚfspathrÙ   ro   rs   ræ   r   FrH   rs   r¹   )Úsuperrñ   rÌ   r£   r¤   r²   r±   ÚtraceÚrootÚgetÚ	frozensetÚ_initialpathsrû   Ú_bestrelpathcachero   ÚpluginmanagerÚregister)rð   ro   ©Ú	__class__ra   rb   rñ   ß  s    úzSession.__init__c                 C   s   | j |d�}|S )NrŸ   )Ú_create)Úclsro   rs   ra   ra   rb   rx   ó  s   zSession.from_configc                 C   s$   d| j j| jt| ddƒ| j| jf S )Nz6<%s %s exitstatus=%r testsfailed=%d testscollected=%d>rw   z<UNSET>)r  r“   rº   Úgetattrr£   r¤   ©rð   ra   ra   rb   Ú__repr__ø  s   
ûzSession.__repr__c                 C   s
   | j jjS )zQThe path from which pytest was invoked.

        .. versionadded:: 7.0.0
        )ro   Úinvocation_paramsrL   r  ra   ra   rb   r—     s   
zSession.startpathÚ	node_pathc                 C   s
   | j | S r�   )r	  )rð   r  ra   ra   rb   Ú_node_location_to_relpath	  s   
z!Session._node_location_to_relpathT)Útryfirstc                 C   s(   | j r	|  | j ¡‚| jr|  | j¡‚d S r�   )r±   r~   r²   r«   r  ra   ra   rb   Úpytest_collectstart  s
   ÿzSession.pytest_collectstartÚreportc                 C   sX   |j r$t|dƒs&|  jd7  _| j d¡}|r(| j|kr*d| j | _d S d S d S d S d S )NÚwasxfailr7   r6   zstopping after %d failures)ÚfailedÚhasattrr£   ro   Úgetvaluer±   )rð   r  r6   ra   ra   rb   Úpytest_runtest_logreport  s   üz Session.pytest_runtest_logreportrI   úos.PathLike[str]c                 C   s    t |tƒr|nt|ƒ}|| jv S r�   )r‡   r   r  )rð   rI   Úpath_ra   ra   rb   Ú
isinitpath   s   
zSession.isinitpathr  c                 C   st   t |tƒr|nt|ƒ}| jj}|j|| j d¡| jjd�}|j |¡}|r4ddl	m
} |t||ƒƒ}|S | jj}|S )NrS   )rÌ   r7   )ÚPathAwareHookProxy)r‡   r   ro   r
  Ú_getconftestmodulesrÚ   rÌ   Ú_conftest_pluginsÚ
differenceÚconfig.compatr!  rí   r{   )rð   r  rI   rî   Úmy_conftestmodulesrï   r!  Úproxyra   ra   rb   Úgethookproxy%  s   
ýÿzSession.gethookproxyÚdirentryzos.DirEntry[str]c                 C   s<   |j dkrdS t|jƒ}|  |j¡}|j|| jd�rdS dS )NÚ__pycache__F©rÊ   ro   T)rº   r   rI   r(  rÙ   rã   ro   )rð   r)  r  Úihookra   ra   rb   Ú_recurse;  s   

zSession._recurseÚhandle_dupesc                 C   s’   |  ¡ sJ d || ¡ | ¡ | ¡ ¡ƒ‚|  |¡}|  |¡s(|j|| jd�r(dS |rB| j 	d¡}|sB| jj
j}||v r=dS | |¡ |j|| d�S )Nz9{!r} is not a file (isdir={!r}, exists={!r}, islink={!r})r+  ra   rO   )Ú	file_pathrÙ   )Úis_fileÚformatrÄ   ÚexistsÚ
is_symlinkr(  r   rã   ro   rÚ   r
  Ú_duplicatepathsÚaddÚpytest_collect_file)rð   r  r.  r,  rO   Úduplicate_pathsra   ra   rb   Ú_collectfileD  s$   ÿÿþ



zSession._collectfile.r*   ÚgenitemszLiteral[True]c                 C   ó   d S r�   ra   ©rð   r*   r9  ra   ra   rb   r¦   \  ó   zSession.perform_collectc                 C   r:  r�   ra   r;  ra   ra   rb   r¦   b  r<  c              
   C   sš  |du r| j j}|  d| |¡ | jj jd7  _g | _g | _g | _| j j}| j}z–g }|D ]}t	| j j
j|| j jjd�\}}| j ||f¡ | |¡ q-t|ƒ| _t| ƒ}	| jj|	d� | jj jd8  _| jr�g }
| jD ]\}}|rƒ|
 d|› d|›d|›d	�¡ qm|
 d
|› �¡ qmt|
Ž ‚|s–|	j}n|	jr¨|	jD ]}| j |  |¡¡ qœ| j j ¡  |j| | j |d� W |j| d� n|j| d� w t|ƒ| _|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¦   r7   ©Ú	as_pypath©r  znot found: z

(no name z in any of ú)zfound no collectors for )rs   ro   r®   rr   )ro   r*   r  r  ÚindentÚ	_notfoundÚ_initial_partsr®   r{   Úresolve_collection_argumentr  rL   r’   Úpyargsr<   r  r  r$   r,  Úpytest_collectreportr   ÚresultÚpassedrÛ   r9  r
  Úcheck_pendingrì   Úpytest_collection_finishr¯   r¤   )rð   r*   r9  r{   r®   ÚinitialpathsÚargr  ÚpartsÚrepÚerrorsÚ
collectorsÚnodera   ra   rb   r¦   h  sX   
ý
ÿ
ÿ
c              	   c   s   � ddl m} i }i }i }i }| jD �]ê\}}|  d||f¡ | jj jd7  _| j dd¡st| jj}|g|j	¢R D ]9}	| 
|¡sC n1|	 ¡ rs|	d }
|
 ¡ rs|
|vrs| j|
dd�}|rst|d |ƒri|d ||	< |d g||d j< q:| ¡ rè|rƒJ d	||f›�ƒ‚tƒ }t|| jƒD ]Y}| ¡ s“qŒt|jƒ}|j}||vrÀ| |¡ |d }
|
 ¡ rÀ|  |
¡D ]}|V  t||ƒr¿|||< q±||v rÅqŒ|  |¡D ]}t|ƒ|jf}||v rÝ|| V  qÊ|||< |V  qÊqŒ�n| ¡ sîJ ‚||v r÷|| }n| |j| ¡}|j|dd�}|�r|||< g }||fg}|�r±|  d
||¡ | jj jd7  _| ¡ \}}|D ]m}|�s:| |¡ �q.t|tjƒ�sC�q.t|ƒ|jf}||v �rT|| }nt|ƒ}|||< |j�r“g }|j D ]}|j!|d k�s||j! "d¡d |d k�r�| |¡ �qe|�r‘| ||dd … f¡ �q.|j#j$|d� �q.|  dt%|ƒd¡ | jj jd8  _|�s|�sÈd &t'|ƒg|¢R ¡}| j( ||f¡ q|j!dk�rït|d |ƒ�rïzt)t*|d  +¡ ƒƒV  W n
 t,�yí   Y nw q|E d H  | jj jd8  _qd S )Nr   )ÚPackagezprocessing argumentr7   ÚdoctestmodulesFz__init__.py)r.  zinvalid arg Ú
matchnodesú[r?  zmatchnodes finished -> r   ú::)-Ú_pytest.pythonrR  rC  r  r  rA  ro   rÚ   r
  rf   Ú_is_in_confcutdirrÄ   r0  r8  r‡   rI   Úsetr!   r-  r   rÙ   r5  r2  r1   r  Úpopr<   r   Ú	Collectorræ   r$   rH  rG  rº   Úsplitr,  rF  r¯   Újoinr\   rB  ÚnextÚiterrG   ÚStopIteration)rð   rR  Únode_cache1Únode_cache2Úmatchnodes_cacheÚ	pkg_rootsÚargpathÚnamesrî   rÙ   ÚpkginitÚcolÚ	seen_dirsr)  rI   ÚdirpathrÐ   Úkey2Úcollect_rootÚmatchingÚworkrT  Ú
matchnamesrQ  ÚkeyrN  Úsubmatchnodesrü   Ú
report_argra   ra   rb   rG   ¯  sÐ   €
€


€úì
þ




€€Ü&ü
 �ýzSession.collectrQ  c                 c   s~   � |   d|¡ t|tjƒr|jj|d� |V  d S t|tjƒs!J ‚t|ƒ}|jr6|j	D ]
}|  
|¡E d H  q+|jj|d� d S )Nr9  )r©   r?  )r  r‡   r   ÚItemr,  Úpytest_itemcollectedr[  r$   rH  rG  r9  rF  )rð   rQ  rN  Úsubnodera   ra   rb   r9  A  s   €

zSession.genitems)r(   N)r  r  )T)..)NT),r“   rö   r÷   rú   r«   r~   r%   rÿ   r   r   r[   r   r   rñ   Úclassmethodrx   r\   r  Úpropertyr   r—   r  r   r  r#   r"   r  rF  rj   r   r(  r-  r	   r   r[  r8  r   r   rs  r¦   r   rG   r9  Ú__classcell__ra   ra   r  rb   rq   Ð  s†   
 	
ÿþ	

ÿÿÿ
þÿ
ÿÿþÿ
ÿÿþÿ
ÿÿ
þG ÿþÚmodule_namec              
   C   sh   zt j | ¡}W n tttfy   |  Y S w |du s%|jdu s%|jdkr'| S |jr1tj	 
|j¡S |jS )zTSearch sys.path for the given a dotted module name, and return its file system path.NÚ	namespace)rR   ÚutilÚ	find_specÚAttributeErrorÚImportErrorÚ
ValueErrorÚoriginÚsubmodule_search_locationsr•   rI   Údirname)ry  Úspecra   ra   rb   Úsearch_pypathQ  s   ÿr„  Fr=  Úinvocation_pathrL  r>  c          
      C   s®   t |ƒ d¡\}}}| d¡^}}|r|d › |› |› �|d< |r%t|ƒ}| | }t|ƒ}t|ƒs?|r5dnd}	t|	j|d�ƒ‚|rS| ¡ rS|rIdnd}	t|	j|d�ƒ‚||f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 tuple:

        (Path("/full/path/to/pkg/tests/test_foo.py"), ["TestClass", "test_foo"])

    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.

    If the path doesn't exist, raise UsageError.
    If the path is a directory and selection parts are present, raise UsageError.
    rU  rV  éÿÿÿÿz9module or package not found: {arg} (missing __init__.py?)z"file or directory not found: {arg})rL  z9package argument cannot contain :: selection parts: {arg}z;directory argument cannot contain :: selection parts: {arg})	r\   Ú	partitionr\  r„  r   r    r   r1  rÄ   )
r…  rL  r>  rd   ÚsquacketÚrestÚstrpathrM  r  rn   ra   ra   rb   rD  b  s*   ÿýÿýrD  )rs   rq   r(   N)Qrú   rh   ÚdataclassesrÔ   r]   rR   r•   rŠ   Úpathlibr   Útypingr   r   r   r   r   r   r	   r
   r   r   r   r   Ú_pytest._coder‚   r   Ú_pytest.compatr   r   Ú_pytest.configr   r   r   r   r   r   Ú_pytest.config.argparsingr   Ú_pytest.fixturesr   Ú_pytest.outcomesr   Ú_pytest.pathlibr   r   r   r    r!   Ú_pytest.reportsr"   r#   Ú_pytest.runnerr$   r%   Útyping_extensionsr&   rc   r\   r_   r[   rœ   r    rž   r¡   rj   r¢   rÉ   rã   rs  rì   rí   r€   r«   r�   r~   Ú	dataclassrû   ÚFSCollectorrq   r„  rD  ra   ra   ra   rb   Ú<module>   s¦     7ÿÿ

þ;"
#   ÿÿÿÿþ