o
    rh(                     @  s  d Z ddlm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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l0m1Z1 ddl0m2Z2 dd l3m4Z4 dd!l3m5Z5 dd"l6m7Z7 erdd#l8m9Z9 dd$l:m;Z; dld)d*Z<dmd-d.Z=dnd4d5Z>dod6d7Z?dpd;d<Z@dqd=d>ZAdrd@dAZBdsdCdDZCdtdGdHZDdudLdMZEdvdPdQZFG dRdS dSZGG dTdU dUeHZIG dVdW dWeJZKejLG dXdY dYeeeMf ZNeG dZd[ d[ejOZPeG d\d9 d9ejQZRdwd_d`ZSejLdadbG dcdd ddZTdedfdxdjdkZUdS )yzHCore implementation of the testing process: init, session, runtest loop.    )annotationsN)Path)AbstractSet)Callable)Dict)final)Iterable)Iterator)Literal)overload)Sequence)TYPE_CHECKING)nodes)Config)directory_arg)ExitCode)hookimpl)PytestPluginManager)
UsageError)Parser)PathAwareHookProxy)exitabsolutepath)bestrelpath
fnmatch_ex)safe_exists)scandir)CollectReport)
TestReport)collect_one_node)
SetupState)PytestWarning)Self)FixtureManagerparserr   returnNonec              	   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^ | j d_d`d/dadb | dcdd}|jdedfd t	dJdgdh 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)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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'.)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;   consider_namespace_packagesboolzEConsider namespace packages when resolving module names during import)r1   r2   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 rc   J/var/www/html/alpaca_bot/venv/lib/python3.10/site-packages/_pytest/main.pypytest_addoption9   sB  
			
re   rI   r^   c                 C  sd   d}| s	t |d	dd}|t t|  rt ||t  t|  r0t || S )
NzWbasetemp must not be empty, the current working directory or any parent directory of itbaser   queryr'   rV   c                 S  s   | |krdS || j v S )z,Return whether query is an ancestor of base.T)parents)rf   rg   rc   rc   rd   is_ancestor   s   
z&validate_basetemp.<locals>.is_ancestor)rf   r   rg   r   r'   rV   )argparseArgumentTypeErrorr   cwdabsoluteresolve)rI   msgri   rc   rc   rd   ra      s   



ra   configr   doit2Callable[[Config, Session], int | ExitCode | None]int | ExitCodec                 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#rt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!
)ru   
exitstatus))Sessionfrom_configr   OKry   _do_configurehookpytest_sessionstartr   USAGE_ERRORFailedTESTS_FAILEDKeyboardInterruptr   	Exception_pytest_codeExceptionInfofrom_currentINTERRUPTED
isinstancevalue
returncodesysstderrwritetypenamero   pytest_keyboard_interruptBaseExceptionINTERNAL_ERRORnotify_exceptionoptionr1   __name__
SystemExitoschdir	startpathpytest_sessionfinish_ensure_unconfigure)rp   rq   ru   	initstaterx   ry   excrc   rc   rd   wrap_session  s   


*

*

*
r   c                 C  s
   t | tS N)r   _mainrp   rc   rc   rd   pytest_cmdline_mainI  s   
r   ru   rz   int | ExitCode | Nonec                 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.rt   r   N)r~   pytest_collectionpytest_runtestlooptestsfailedr   r   testscollectedNO_TESTS_COLLECTED)rp   ru   rc   rc   rd   r   M  s   
r   c                 C  s   |    d S r   )perform_collectrt   rc   rc   rd   r   Z  s   r   rV   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   rp   r   rE   Interruptedcollectonly	enumerateitemslenr~   pytest_runtest_protocol
shouldfailr   
shouldstop)ru   ir   r   rc   rc   rd   r   ^  s(   
$r   r   c                 C  s6   z|  d p|  dd W S  ty   Y dS w )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rI   rc   rc   rd   _in_venvr  s   r   collection_pathbool | Nonec                   s    j dkrdS |jd jd}|pg }|d}|r$|dd |D   |v r*dS |jd jd}|p5g }|d	}|rG|d
d |D  t fdd|D rTdS |d}|sat radS   rw|d}t fdd|D rwdS d S )N__pycache__Tcollect_ignorer   ignorec                 s      | ]}t |V  qd S r   r   .0xrc   rc   rd   	<genexpr>      z(pytest_ignore_collect.<locals>.<genexpr>collect_ignore_globignore_globc                 s  r   r   r   r   rc   rc   rd   r     r   c                 3  s$    | ]}t  t t|V  qd S r   )fnmatchr^   )r   globr   rc   rd   r     s   " rP   r)   c                 3  s    | ]}t | V  qd S r   r   )r   patr   rc   rd   r     s    )	name_getconftest_pathlistparent	getoptionextendanyr   is_dirgetini)r   rp   ignore_paths
excludeoptignore_globsexcludegloboptallow_in_venvnorecursepatternsrc   r   rd   pytest_ignore_collect  s8   




r   r   nodes.Collectornodes.Collector | Nonec                 C  s   t j|| dS )Nr   )Dirfrom_parentrI   r   rc   rc   rd   pytest_collect_directory  s   r   r   list[nodes.Item]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   nodeid
startswithr<   r~   pytest_deselected)r   rp   deselect_prefixes	remaining
deselectedcolitemrc   rc   rd   pytest_collection_modifyitems  s   r   c                   @  s    e Zd ZdddZdddZdS )FSHookProxypmr   remove_modsAbstractSet[object]r'   r(   c                 C  s   || _ || _d S r   )r   r   )selfr   r   rc   rc   rd   __init__  s   
zFSHookProxy.__init__r   r^   pluggy.HookCallerc                 C  s    | j j|| jd}|| j|< |S )N)remove_plugins)r   subset_hook_callerr   __dict__)r   r   r   rc   rc   rd   __getattr__  s   
zFSHookProxy.__getattr__N)r   r   r   r   r'   r(   )r   r^   r'   r   )r   
__module____qualname__r   r   rc   rc   rc   rd   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__rc   rc   rc   rd   r     s    r   c                   @  s   e Zd ZdZdS )r   z"Signals a stop as failed test run.Nr   rc   rc   rc   rd   r     s    r   c                   @  s$   e Zd ZU dZded< d	ddZdS )
_bestrelpath_cacher   r   rI   r'   r^   c                 C  s   t | j|}|| |< |S r   )r   rI   )r   rI   rrc   rc   rd   __missing__  s   z_bestrelpath_cache.__missing__N)rI   r   r'   r^   )r   r   r   	__slots____annotations__r  rc   rc   rc   rd   r     s   
 r   c                      s0   e Zd ZdZed fdd	ZdddZ  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   r   rI   r   r'   r$   c                  s   t  j||dS )zThe public constructor.

        :param parent: The parent collector of this Dir.
        :param path: The directory's path.
        :type path: pathlib.Path
        )r   rI   )superr   )clsr   rI   	__class__rc   rd   r     s   zDir.from_parent&Iterable[nodes.Item | nodes.Collector]c                 c  s    | j }| j}t| jD ]M}| r6t|j}| jj|dds'|j||dr'q|j	|| d}|d ur5|V  q|
 rYt|j}| j|sM|j||drMq|j|| d}|E d H  qd S )NTwith_parents)r   rp   r   	file_pathr   )rp   ihookr   rI   r   r   ru   
isinitpathr   r   r   pytest_collect_file)r   rp   r  direntryrI   colcolsrc   rc   rd   rG     s,   


zDir.collect)r   r   rI   r   r'   r$   )r'   r  )r   r   r   r   classmethodr   rG   __classcell__rc   rc   r  rd   r     s
    r   c                      sT  e Zd ZU dZeZeZded< ded< ded< dT fddZedUddZ	dVddZ
edWddZejdXddZedWddZejdXddZedYddZdZdd Zed!d"d[d#d$Zed!d"d\d'd(ZeZd)d*d]d/d0Zd^d4d5Zd_d9d:Ze	;d`dadAdBZe	;d`dbdDdBZ	!dcdbdFdBZ	!dddedKdLZdfdNdOZdgdRdSZ  ZS )hrz   zoThe root of the collection tree.

    ``Session`` collects the initial paths given as arguments to pytest.
    r"   _setupstater%   _fixturemanagerrs   ry   rp   r   r'   r(   c              	     s   t  jd|jd d || dd d| _d| _d| _d| _|jj	d| _t
 | _t
 | _g | _g | _i | _g | _t|j| _| jjj| dd d S )Nr   )r   rI   fspathr   rp   ru   r   r   FrH   ru   )r   )r  r   rootpathr   r   _shouldstop_shouldfailtracerootget	frozenset_initialpaths_initialpaths_with_parents	_notfound_initial_parts_collection_cacher   r   _bestrelpathcacherp   pluginmanagerregister)r   rp   r  rc   rd   r   -  s,   	zSession.__init__c                 C  s   | j |d}|S )Nr   )_create)r  rp   ru   rc   rc   rd   r{   G  s   zSession.from_configr^   c                 C  s$   d| j j| jt| dd| j| jf S )Nz6<%s %s exitstatus=%r testsfailed=%d testscollected=%d>ry   z<UNSET>)r  r   r   getattrr   r   r   rc   rc   rd   __repr__L  s   
zSession.__repr__
bool | strc                 C     | j S r   )r  r)  rc   rc   rd   r   U     zSession.shouldstopr   c                 C  .   |du r| j rtjtddd d S || _ d S )NFzCsession.shouldstop cannot be unset after it has been set; ignoring.rv   
stacklevel)r  warningswarnr#   r   r   rc   rc   rd   r   Y     
c                 C  r,  r   )r  r)  rc   rc   rd   r   g  r-  zSession.shouldfailc                 C  r.  )NFzCsession.shouldfail cannot be unset after it has been set; ignoring.rv   r/  )r  r1  r2  r#   r3  rc   rc   rd   r   k  r4  r   c                 C  s
   | j jjS )zQThe path from which pytest was invoked.

        .. versionadded:: 7.0.0
        )rp   invocation_paramsrL   r)  rc   rc   rd   r   y  s   
zSession.startpath	node_pathc                 C  s
   | j | S r   )r$  )r   r6  rc   rc   rd   _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)  rc   rc   rd   pytest_collectstart  s
   zSession.pytest_collectstartreportTestReport | CollectReportc                 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   rp   getvaluer   )r   r:  r6   rc   rc   rd   pytest_runtest_logreport  s   z Session.pytest_runtest_logreportFr	  rI   str | os.PathLike[str]r
  rV   c                C  s.   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   r   r  )r   rI   r
  path_rc   rc   rd   r    s   

zSession.isinitpathr  os.PathLike[str]pluggy.HookRelayc                 C  sV   t |tr|nt|}| jj}||}|j|}|r%tt||}|S | jj	}|S r   )
r   r   rp   r%  _getconftestmodules_conftest_plugins
differencer   r   r~   )r   r  rI   r   my_conftestmodulesr   proxyrc   rc   rd   gethookproxy  s   
zSession.gethookproxy
path_cache%dict[Path, Sequence[nodes.Collector]]Sequence[nodes.Collector]c                 C  sx   ||v r|| S |  r#| |j}|j|| d}|dur |fnd}n| r4| |}|j|| d}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   Nrc   r  )r   rJ  r   r   r   r  )r   rI   rK  r  r  r  rc   rc   rd   _collect_path  s   

zSession._collect_path.r*   Sequence[str] | NonegenitemsLiteral[True]Sequence[nodes.Item]c                 C     d S r   rc   r   r*   rP  rc   rc   rd   r        zSession.perform_collect&Sequence[nodes.Item | nodes.Collector]c                 C  rS  r   rc   rT  rc   rc   rd   r     rU  Nc              	   C  s  |du r| j j}| d| | | jj jd7  _| j j}g | _g | _i | _g | _	| j	}zg }g }|D ](}t
| j jj|| j jjd}| j| ||j ||j ||jj q2t|| _t|| _t| }	| jj|	d | jj jd8  _| jrg }
| jD ]\}}|r|
d| d|d q|
d	|  qt|
 |s|	j}n|	jr|	jD ]}| j	| | q| j j  |j| | j |d
 W g | _g | _i | _|j | d ng | _g | _i | _|j | d w |rt!|| _"|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 match in any of )zfound no collectors for )ru   rp   r   rt   )#rp   r*   r  r  indentr~   r!  r"  r#  r   resolve_collection_argumentr5  rL   r   pyargsr<   rI   r   rh   r  r  r   r!   r  pytest_collectreportr   resultpassedrP  r%  check_pendingr   pytest_collection_finishr   r   )r   r*   rP  r~   r   initialpathsinitialpaths_with_parentsargcollection_argumentreperrors
collectorsnoderc   rc   rd   r     sr   



rj  r   handle_dupestuple[CollectReport, bool]c                 C  s:   || j v r|r| j | }|dfS t|}|| j |< |dfS )NTF)r#  r!   )r   rj  rk  rg  rc   rc   rd   _collect_one_node:  s   

zSession._collect_one_node&Iterator[nodes.Item | nodes.Collector]c                 c  s   i }| j j}| jD ]`}| d| | jj jd7  _|j}|j}|j}|	 r4|r4J d||f|g}|d u rO|j
D ]}||sG n|d| q>n&|d}	t|j
dD ]\}
}|
t|	ksl|j|	|
  krn n|d| qZd}g }| g ||fg}|rL| \}}|s|V  d}qt|tjsqt|trt|d tsJ ||d |}n/t|dkot|d to|d   }| ||\}}|s|js|jj|d	 |jsq|j}d}t|D ][}t|d tr|j|d k}tj d
kr|st!j"|j|d }|ot!j#|jt!j#|d k}n|j$|d kp0|j$dd |d k}|rA|%||dd  f d}q|sJ|%| |s|sbd&t'|g|R }| j(%||f | jj jd8  _q
d S )Nzprocessing argumentr7   zinvalid arg r   .rv   FTrY  win32[::))rp   r%  r"  r  r  r[  rI   partsmodule_namer   rh   _is_in_confcutdirinsertsplitr   r   stempopr   r   	Collectorrz   r   rN  r   rm  r`  r  r^  r_  reversedr   platformr   samefileislinkr   r<   joinr^   r!  )r   rK  r   rf  argpathnamesrt  pathsrI   module_name_partsr   any_matched_in_initial_partnotfound_collectorswork	matchnode
matchpartssubnodesrk  rg  	duplicateany_matched_in_collectorrj  is_match	same_file
report_argrc   rc   rd   rG   G  s   







FzSession.collectnodes.Item | nodes.CollectorIterator[nodes.Item]c                 c  s    |  d| t|tjr|jj|d |V  d S t|tjs!J | jd}|o.t|tj	 }| 
||\}}|r>|s>d S |jrO|jD ]
}| |E d H  qD|sZ|jj|d d S d S )NrP  )r   rO   rY  )r  r   r   Itemr  pytest_itemcollectedrz  rp   r   Filerm  r`  r_  rP  r^  )r   rj  rO   rk  rg  r  subnoderc   rc   rd   rP    s"   

zSession.genitems)rp   r   r'   r(   )rp   r   r'   rz   )r'   r^   )r'   r+  )r   r+  r'   r(   )r'   r   )r6  r   r'   r^   )r'   r(   )r:  r;  r'   r(   )rI   rA  r
  rV   r'   rV   )r  rC  r'   rD  )rI   r   rK  rL  r'   rM  )..)r*   rO  rP  rQ  r'   rR  )r*   rO  rP  rV   r'   rV  )NT)T)rj  r   rk  rV   r'   rl  )r'   rn  )rj  r  r'   r  )r   r   r   r   r   r   r  r   r  r{   r*  propertyr   setterr   r   r7  r   r9  r@  r^  r  rJ  rN  r   r   rm  rG   rP  r  rc   rc   r  rd   rz     sV   
 
	


U
yrt  
str | Nonec              
   C  sf   zt j| }W n tttfy   Y dS w |du s$|jdu s$|jdkr&dS |jr0t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)rR   util	find_specAttributeErrorImportError
ValueErrororiginsubmodule_search_locationsr   rI   dirname)rt  specrc   rc   rd   search_pypath  s   r  T)frozenc                   @  s*   e Zd ZU dZded< ded< ded< dS )	CollectionArgumentzA resolved collection argument.r   rI   zSequence[str]rs  r  rt  N)r   r   r   r   r  rc   rc   rc   rd   r    s
   
 r  FrW  invocation_pathre  rX  c                C  s   t |d\}}}|d^}}|r|d  | | |d< d}|r/t|}	|	dur/|}|	}| | }
t|
}
t|
sI|r?dnd}t|j|d|r]|
 r]|rSdnd	}t|j|dt	|
||d
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.
    rq  rr  Nz9module or package not found: {arg} (missing __init__.py?)z"file or directory not found: {arg})re  z9package argument cannot contain :: selection parts: {arg}z;directory argument cannot contain :: selection parts: {arg})rI   rs  rt  )
r^   	partitionrw  r  r   r   r   formatr   r  )r  re  rX  rf   squacketreststrpathrs  rt  pyarg_strpathr  ro   rc   rc   rd   r\    s:   #r\  )r&   r   r'   r(   )rI   r^   r'   r^   )rp   r   rq   rr   r'   rs   )rp   r   r'   rs   )rp   r   ru   rz   r'   r   )ru   rz   r'   r(   )ru   rz   r'   rV   )rI   r   r'   rV   )r   r   rp   r   r'   r   )rI   r   r   r   r'   r   )r   r   rp   r   r'   r(   )rt  r^   r'   r  )r  r   re  r^   rX  rV   r'   r  )Vr   
__future__r   rj   dataclassesr   r_   rR   importlib.utilr   pathlibr   r   typingr   r   r   r   r   r	   r
   r   r   r   r1  pluggyr   r   _pytest._code_pytest.configr   r   r   r   r   r   _pytest.config.argparsingr   _pytest.config.compatr   _pytest.outcomesr   _pytest.pathlibr   r   r   r   r   _pytest.reportsr   r    _pytest.runnerr!   r"   _pytest.warning_typesr#   typing_extensionsr$   _pytest.fixturesr%   re   ra   r   r   r   r   r   r   r   r   r   r   r   r   r   r   	dataclassr^   r   	Directoryr   rz  rz   r  r  r\  rc   rc   rc   rd   <module>   s    
 
=

;





&
3   
8
	