o
    Zh[                    @   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m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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m&Z& ddlm'Z' ddlm(Z( ddlm)Z) ddlm*Z* ddl+Z+ddl,Z,ddl,m-Z- ddl,m.Z. ddl,m/Z/ ddl,m0Z0 ddl,m1Z1 dd l2m3Z3 dd!l4m5Z5 dd"l4m6Z6 dd#l7m8Z8 ddl9Z:dd$l9m;Z; dd%l9m<Z< dd&l=m>Z> ddl?Z:ddl@Z:dd'lAmBZB dd(lAmCZC dd)lDmEZE dd*lDmFZF dd+lDmGZG dd,lDmHZH dd-lDmIZI dd.lDmJZJ dd/lKmLZL dd0lMmNZN dd1lMmOZO e)rydd2lPmQZQ dd3lPmRZR dd4lSmTZT dd5lUmVZV eWZX	 e-d6ZYe/d6ZZeG d7d8 d8ej[Z\G d9d: d:e]Z^d;e:j_j`d<eafd=d>Zb		dd?e#e*e"ec d@f  dAe#e$e*eceXf   d<e*ede\f fdBdCZed<edfdDdEZfG dFdG dGZgdHecdIecd<ecfdJdKZhdHecdIecd<ecfdLdMZidNZjg ejdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhR ZkelekZmemndi emndj 		dd?e#e"ec  dAe#e$e*eceXf   d<dkfdldmZoddodpZp		dd?e#e*e"ec d@f  dAe#e$e*eceXf   d<dkfdqdrZqdHed<efdsdtZrduedvecdwe'ecdxf d<eeceaf fdydzZseG d{dn dne1Ztd|e*dejuece$ec f d<e"ec fd}d~ZvG dd dZwew Zxde ec d<e!ec fddZyeG ddk dkZzd<eafddZ{	ddezde#e& d<e>fddZ|decd<eafddZ}edddecdead<e'dece(e~ ecedf fddZdecd<e(e~ fddZde ec de ec d<dfddZdS )z:Command line options, ini-file and conftest.py processing.    N)	lru_cache)Path)dedent)FunctionType)Any)Callable)cast)Dict)Final)final)	Generator)IO)Iterable)Iterator)List)Optional)Sequence)Set)TextIO)Tuple)Type)TYPE_CHECKING)Union)HookimplMarker)HookimplOpts)HookspecMarker)HookspecOpts)PluginManager   )PathAwareHookProxy)	PrintHelp)
UsageError)determine_setup)ExceptionInfo)filter_traceback)TerminalWriter)fail)Skipped)absolutepath)bestrelpath)import_path)
ImportMode)resolve_package_path)safe_exists)Stash)PytestConfigWarning)warn_explicit_for)ArgumentParser)_TracebackStyle)TerminalReporterpytestc                   @   s(   e Zd ZdZdZdZdZdZdZdZ	dS )	ExitCodezEncodes the valid exit codes by pytest.

    Currently users and plugins may supply other exit codes as well.

    .. versionadded:: 5.0
    r   r               N)
__name__
__module____qualname____doc__OKZTESTS_FAILEDZINTERRUPTEDINTERNAL_ERRORUSAGE_ERRORZNO_TESTS_COLLECTED rC   rC   N/var/www/html/lang_env/lib/python3.10/site-packages/_pytest/config/__init__.pyr7   \   s    r7   c                   @   s0   e Zd ZdededdfddZdefddZdS )	ConftestImportFailurepathcausereturnNc                C   s   || _ || _d S N)rF   rG   )selfrF   rG   rC   rC   rD   __init__t   s   
zConftestImportFailure.__init__c                 C   s"   t | jj d| j d| j dS )N: z (from ))typerG   r<   rF   rJ   rC   rC   rD   __str__}   s   "zConftestImportFailure.__str__)r<   r=   r>   r   	ExceptionrK   strrP   rC   rC   rC   rD   rE   s   s    
	rE   entryrH   c                 C   s   t | odt| jtjvS )zFilter tracebacks entries which point to pytest internals or importlib.

    Make a special case for importlib because we use it to import test modules and conftest files
    in _pytest.pathlib.import_path.
    	importlib)r$   rR   rF   splitossep)rS   rC   rC   rD   ,filter_traceback_for_conftest_import_failure   s   rX   argszos.PathLike[str]pluginsc              
   C   sh  zzt | |}W nV ty^ } zJt|j}ttj}|jd|j	 ddd |j
t|_
|j
r8|jdddn| }t|}| D ]}|j| dd qDtjW  Y d}~W S d}~ww z$|jj|d	}	zt|	W W |  W S  ty   |	 Y W |  W S w |  w  ty } zttj}|jD ]}
|jd
|
 ddd qtjW  Y d}~S d}~ww )aL  Perform an in-process test run.

    :param args:
        List of command line arguments. If `None` or not given, defaults to reading
        arguments directly from the process command line (:data:`sys.argv`).
    :param plugins: List of plugin objects to be auto-registered during initialization.

    :returns: An exit code.
    z$ImportError while loading conftest 'z'.T)redZshortF)stylechainNconfigzERROR: 
)_prepareconfigrE   r#   from_exceptionrG   r%   sysstderrlinerF   	tracebackfilterrX   getreprZexconlyrR   
splitlinesrstripr7   rB   hookZpytest_cmdline_main_ensure_unconfigure
ValueErrorr!   rY   )rY   rZ   r_   eexc_infotwZexc_reprZformatted_tbre   retmsgrC   rC   rD   main   sN   




rs   c                  C   sN   zt  } tj  | W S  ty&   ttjtj}t	|tj
  Y dS w )zoThe CLI entry point of pytest.

    This function is not meant for programmable use; use `main()` instead.
    r   )rs   rc   stdoutflushBrokenPipeErrorrV   opendevnullO_WRONLYdup2fileno)coderx   rC   rC   rD   console_main   s   
r}   c                   @   s   e Zd ZeeZdS )cmdlineN)r<   r=   r>   staticmethodrs   rC   rC   rC   rD   r~          r~   rF   optnamec                 C   s"   t j| rt| d|  | S )ztArgparse type validator for filename arguments.

    :path: Path of filename.
    :optname: Name of the option.
    z must be a filename, given: rV   rF   isdirr!   rF   r   rC   rC   rD   filename_arg      r   c                 C   s"   t j| st| d|  | S )zvArgparse type validator for directory arguments.

    :path: Path of directory.
    :optname: Name of the option.
    z must be a directory, given: r   r   rC   rC   rD   directory_arg   r   r   )markrs   runnerZfixturesZ
helpconfigpythonZterminalZ	debuggingZunittestcaptureZskippingZ
legacypathZtmpdirZmonkeypatchZrecwarnZpastebin	assertionZjunitxmldoctestcacheproviderZfreeze_supportZ	setuponlyZ	setupplanstepwisewarningsloggingZreportsZpython_pathZunraisableexceptionZthreadexceptionfaulthandlerZpytesterZpytester_assertionsConfigc                 C   sT   t  }t|tj| p
d|t dd}| d ur|j| dd tD ]}|| q |S )NrC   rY   rZ   dirinvocation_paramsTexclude_only)PytestPluginManagerr   InvocationParamsr   cwdconsider_preparsedefault_pluginsimport_plugin)rY   rZ   pluginmanagerr_   specrC   rC   rD   
get_config  s   	r   r   c                   C   s   t  jS )zObtain a new instance of the
    :py:class:`pytest.PytestPluginManager`, with default plugins
    already loaded.

    This function can be used by integration with other tools, like hooking
    into pytest to run tests into an IDE.
    )r   r   rC   rC   rC   rD   get_plugin_manager/  s   r   c                 C   s   | d u rt jdd  } nt| tjrt| g} nt| ts*d}t|| t	| t
| |}|j}z"|rJ|D ]}t|trD|| q7|| q7|jj|| d}|W S  ty`   |   w )Nr   zG`args` parameter expected to be a list of strings, got: {!r} (type: {}))r   rY   )rc   argv
isinstancerV   PathLikefspathlist	TypeErrorformatrN   r   r   rR   consider_pluginargregisterrk   pytest_cmdline_parseBaseExceptionrl   )rY   rZ   rr   r_   r   pluginrC   rC   rD   ra   :  s0   


ra   c                 C   s   |   r| jS | S )z<Get the directory of a path - itself if already a directory.)is_fileparent)rF   rC   rC   rD   _get_directoryZ  s   r   method	hook_type	opt_names.c           
      C   s   t r	t| s	J dd t| dg D }g }i }|D ]0}t| |t}|tur5|| d|  d||< q||v rF|| d d||< qd||< q|red|}tjj	j
|| j|d	}	ttt| |	 |S )
Nc                 S   s   h | ]}|j qS rC   name).0mrC   rC   rD   	<setcomp>j  s    z)_get_legacy_hook_marks.<locals>.<setcomp>Z
pytestmark=Tz=TrueF, )rN   fullname	hook_opts)r   inspect	isroutinegetattrAttributeErrorappendjoin_pytest
deprecatedZHOOK_LEGACY_MARKINGr   r>   r0   r   r   )
r   r   r   Zknown_marksZ	must_warnoptsZopt_nameZopt_attrr   messagerC   rC   rD   _get_legacy_hook_marksb  s.   



r   c                       sj  e Zd ZdZdI fddZdededee f fdd	Z	dedee
 f fd
dZ	dJdedee dee f fddZdefddZdedefddZdKddZdeeeef  dedededee dedeeef deddfddZd edefd!d"Zd#edeeef dededdf
d$d%Zd edeeef dededdf
d&d'Zd edeej fd(d)Zded edeejef fd*d+Zd,edeeef dededejf
d-d.Zd/ejd,eddfd0d1Z d2d3dee d4eddfd5d6Z!d7eddfd8d9Z"d:ejd;eddfd<d=Z#dId>d?Z$d/ejddfd@dAZ%dBedejeee f ddfdCdDZ&dLdEedFeddfdGdHZ'  Z(S )Mr   a;  A :py:class:`pluggy.PluginManager <pluggy.PluginManager>` with
    additional pytest-specific functionality:

    * Loading plugins from the command line, ``PYTEST_PLUGINS`` env variable and
      ``pytest_plugins`` global variables found in plugins being loaded.
    * ``conftest.py`` loading during start-up.
    rH   Nc                    s   dd l }t d t | _i | _d | _d| _tdt	| _	g | _
| |j | |  tjdratj}t|dd}ztt| |jd|d	}W n	 tyT   Y nw | jj|j |   |j | _ d| _!d S )
Nr   r6   F   ZPYTEST_DEBUGencodingutf8r   )mode	bufferingr   )"_pytest.assertionsuperrK   set_conftest_plugins_dirpath2confmods_confcutdir_noconftestr   r   skipped_pluginsZadd_hookspecshookspecr   rV   environgetrc   rd   r   rw   dupr{   r   rQ   tracerootZ	setwriterwriteZenable_tracingr   ZDummyRewriteHookrewrite_hook_configured)rJ   r   errr   	__class__rC   rD   rK     s6   


zPytestPluginManager.__init__r   r   c                    sX   | dsdS |dkrdS t ||}|dur|S t||}t|s&dS t|ddS ):meta private:pytest_Npytest_pluginsimpl)ZtryfirsttrylastZoptionalhookZhookwrapper)
startswithr   parse_hookimpl_optsr   r   r   r   )rJ   r   r   r   r   r   rC   rD   r     s   


z'PytestPluginManager.parse_hookimpl_optsc                    s:   t  ||}|du rt||}|drt|dd}|S )r   Nr   r   )ZfirstresultZhistoric)r   parse_hookspec_optsr   r   r   )rJ   Zmodule_or_classr   r   r   r   rC   rD   r     s   

z'PytestPluginManager.parse_hookspec_optsc              	      sv   |t jjv rttd|dd d S t 	||}|d ur9| j
jjt||| dd t|tjr9| | |S )NzQ{} plugin has been merged into the core, please remove it from your requirements._-)r   plugin_namemanagerkwargs)r   r   ZDEPRECATED_EXTERNAL_PLUGINSr   warnr/   r   replacer   r   rk   Zpytest_plugin_registeredcall_historicdictr   types
ModuleTypeconsider_module)rJ   r   r   r   r   rC   rD   r     s,   

zPytestPluginManager.registerc                 C   s   |  |}|S rI   )
get_plugin)rJ   r   r   rC   rC   rD   	getplugin  s   
zPytestPluginManager.getpluginc                 C   s   t | |S )z:Return whether a plugin with the given name is registered.)boolr   )rJ   r   rC   rC   rD   	hasplugin     zPytestPluginManager.haspluginr_   r   c                 C   s"   | dd | dd d| _dS )r   markersztryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead.ztrylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. DEPRECATED, use @pytest.hookimpl(trylast=True) instead.TN)addinivalue_liner   )rJ   r_   rC   rC   rD   pytest_configure
  s   
z$PytestPluginManager.pytest_configurerY   pyargs
noconftestrootpath
confcutdirinvocation_dir
importmodeconsider_namespace_packagesc                C   s   |rt || nd| _|| _|| _d}	|D ]*}
t|
}|d}|dkr*|d| }t || }t|r?| j||||d d}	q|	sM| j||||d dS dS )a`  Load initial conftest files given a preparsed "namespace".

        As conftest files may add their own command line options which have
        arguments ('--my-opt somepath') we might get some false positives.
        All builtin and 3rd party plugins will have been loaded, however, so
        common options will not confuse our logic here.
        NFz::r  T)r(   r   r   _using_pyargsrR   findr-   _try_load_conftest)rJ   rY   r   r  r  r  r  r  r  ZfoundanchorZintitial_pathrF   ianchorrC   rC   rD   _set_initial_conftests  s8   

z*PytestPluginManager._set_initial_conftestsrF   c                 C   s   | j du rdS || j jvS )z:Whether to consider the given path to load conftests from.NT)r   parents)rJ   rF   rC   rC   rD   _is_in_confcutdirR  s   

z%PytestPluginManager._is_in_confcutdirr  c                C   sL   | j ||||d | r"|dD ]}| r!| j ||||d qd S d S )Nr  ztest*)_loadconftestmodulesis_dirglob)rJ   r  r  r  r  xrC   rC   rD   r  a  s$   z&PytestPluginManager._try_load_conftestc          
      C   s   | j rd S | |}|| jv rd S g }t|g|jR D ]}| |r9|d }| r9| j||||d}	||	 q|| j|< d S )Nzconftest.pyr  )	r   r   r   reversedr  r  r   _importconftestr   )
rJ   rF   r  r  r  	directoryZclistr   conftestpathmodrC   rC   rD   r  z  s&   



z(PytestPluginManager._loadconftestmodulesc                 C   s   |  |}| j|dS )NrC   )r   r   r   )rJ   rF   r  rC   rC   rD   _getconftestmodules  s   
z'PytestPluginManager._getconftestmodulesc              	   C   sF   |  |}t|D ]}z
|t||fW   S  ty   Y q	w t|rI   )r  r  r   r   KeyError)rJ   r   rF   modulesr  rC   rC   rD   _rget_with_confmod  s   
z&PytestPluginManager._rget_with_confmodr  c             
   C   sB  t |}| |}|d urttj|S t|}|d u r,ztj|j= W n	 t	y+   Y nw z
t
||||d}W n tyP }	 z|	jd usEJ t||	d|	d }	~	ww | || | j| |j}
|
| jv r| j D ]%\}}|
|jv sw||
kr||v rtd|d| d|j d|| qj| d| | j||d |S )	N)r   r   r  )rG   z#While trying to load conftest path z, found that the module z is already loaded with path zE. This is not supposed to happen. Please report this issue to pytest.zloading conftestmodule )registration_name)rR   r   r   r   r   r,   rc   r  stemr  r*   rQ   __traceback__rE   _check_non_top_pytest_pluginsr   addr   r   itemsr  AssertionError__file__r   r   consider_conftest)rJ   r  r  r  r  Zconftestpath_plugin_nameexistingpkgpathr  rn   dirpathrF   modsrC   rC   rD   r    sT   



z#PytestPluginManager._importconftestr  c                 C   s@   t |dr| jr| jsd}t||| jdd d S d S d S d S )Nr   af  Defining 'pytest_plugins' in a non-top-level conftest is no longer supported:
It affects the entire test suite instead of just below the conftest as expected.
  {}
Please move it to a top level conftest file at the rootdir:
  {}
For more information, visit:
  https://docs.pytest.org/en/stable/deprecations.html#pytest-plugins-in-non-top-level-conftest-filesF)Zpytrace)hasattrr   r	  r&   r   r   )rJ   r  r  rr   rC   rC   rD   r!    s   	z1PytestPluginManager._check_non_top_pytest_pluginsFr   r   c                C   s   d}t |}||k rU|| }|d7 }t|trO|dkr1z|| }W n
 ty+   Y dS w |d7 }n|dr=|dd }nq| }|rJ|dsJq| | ||k s
dS dS )r   r   r   z-pNr8   no:)lenr   rR   
IndexErrorr   stripr   )rJ   rY   r   r  noptZpargrC   rC   rD   r     s*   



z%PytestPluginManager.consider_preparseargc                 C   s   | dr8|dd }|tv rtd| |dkr#| d | d | | | ds6| d|  dS dS |}| | | dsK| d|  | j|d	d
 dS )r   r,  r9   Nzplugin %s cannot be disabledr   r   Zpytest_stepwiser   T)consider_entry_points)r   essential_pluginsr!   Zset_blockedZunblockr   )rJ   r2  r   rC   rC   rD   r     s    






z&PytestPluginManager.consider_pluginargconftestmoduler  c                 C   s   | j ||d dS )r   r   N)r   )rJ   r5  r  rC   rC   rD   r&  *  s   z%PytestPluginManager.consider_conftestc                 C   s   |  tjd dS )r   ZPYTEST_PLUGINSN)_import_plugin_specsrV   r   r   rO   rC   rC   rD   consider_env0     z PytestPluginManager.consider_envc                 C   s   |  t|dg  dS )r   r   N)r6  r   )rJ   r  rC   rC   rD   r   4  r8  z#PytestPluginManager.consider_moduler   c                 C   s    t |}|D ]}| | qd S rI   )_get_plugin_specs_as_listr   )rJ   r   rZ   Zimport_specrC   rC   rD   r6  8  s   z(PytestPluginManager._import_plugin_specsmodnamer3  c              
   C   s
  t |tsJ d| | |s| |durdS |tv r!d| n|}| j| |r6| jd|d}|r6dS zt| W n; t	yZ } zt	d| d|j
d  |j|d}~w tyw } z| j||jpid	f W Y d}~dS d}~ww tj| }| || dS )
zImport a plugin with ``modname``.

        If ``consider_entry_points`` is True, entry point names are also
        considered to find a plugin.
        z$module name as text required, got %rNz_pytest.pytest11r   zError importing plugin "z": r    )r   rR   
is_blockedr   builtin_pluginsr   mark_rewriteload_setuptools_entrypoints
__import__ImportErrorrY   with_tracebackr   r'   r   r   rr   rc   r  r   )rJ   r:  r3  Z
importspecZloadedrn   r  rC   rC   rD   r   ?  s4   

$
z!PytestPluginManager.import_pluginrH   NrI   )r_   r   rH   N)F))r<   r=   r>   r?   rK   _PluggyPluginrR   r   r   r   r   r   r   r   r   r   r   r   r   r   r+   r  r  r  r  r   r   r  r   r   r  r  r!  r   r   r&  r7  r   r6  r   __classcell__rC   rC   r   rD   r     s    3



3



 


5




 specsc                 C   sZ   | du rg S t | tjrg S t | tr| r| dS g S t | tjjr't| S t	d|  )z:Parse a plugins specification into a list of plugin names.N,zYPlugins may be specified as a sequence or a ','-separated string of plugin names. Got: %r)
r   r   r   rR   rU   collectionsabcr   r   r!   )rG  rC   rC   rD   r9  e  s   
r9  c                   @   s   e Zd Zdd ZdS )Notsetc                 C   s   dS )Nz<NOTSET>rC   rO   rC   rC   rD   __repr__|  s   zNotset.__repr__N)r<   r=   r>   rL  rC   rC   rC   rD   rK  {  r   rK  package_filesc                 c   s    t | } d}| D ]=}d|vo|d}|ddko|d}|r9tj|\}}|dkr8|ds8d}|V  q	|rFtj|}d}|V  q	|spg }| D ]}|d}	d	|	dd	 }
|
rd|
|
 qM|rrt|E d	H  d	S d	S d	S )
aM  Given an iterable of file names in a source distribution, return the "names" that should
    be marked for assertion rewrite.

    For example the package "pytest_mock/__init__.py" should be added as "pytest_mock" in
    the assertion rewrite mechanism.

    This function has to deal with dist-info based distributions and egg based distributions
    (which are still very much in use for "editable" installs).

    Here are the file names as seen in a dist-info based distribution:

        pytest_mock/__init__.py
        pytest_mock/_version.py
        pytest_mock/plugin.py
        pytest_mock.egg-info/PKG-INFO

    Here are the file names as seen in an egg based distribution:

        src/pytest_mock/__init__.py
        src/pytest_mock/_version.py
        src/pytest_mock/plugin.py
        src/pytest_mock.egg-info/PKG-INFO
        LICENSE
        setup.py

    We have to take in account those two distribution flavors in order to determine which
    names should be considered for assertion rewriting.

    More information:
        https://github.com/pytest-dev/pytest-mock/issues/167
    F/z.pyr   z__init__.pysetupZ__editable__TN)r   endswithcountrV   rF   splitextr   dirnamerU   r   r   _iter_rewritable_modules)rM  Z	seen_somefnZis_simple_module
is_packagemodule_namer   package_nameZnew_package_filespartsZnew_fnrC   rC   rD   rT    s:    

rT  c                   @   s  e Zd ZU dZeejddG dd dZG dd dej	Z
dd	d
edee ddfddZedefddZedee fddZdeg df ddfddZdddZdddZdefddZd
edee dd fddZ	ddee d eej ddfd!d"Zd#edefd$d%Z e!dd&d'Z"dd*d+Z#e$dd,dd.d/Z%de&e ddfd0d1Z'de&e ddfd2d3Z(dd4d5Z)dee d6edee fd7d8Z*dee d9e+d:ee d;ed<ed=e+de,ee e
f fd>d?Z-ddee d@e+ddfdAdBZ.e$ddCde/de0e0f fdDdEZ1ddFdGZ2ddHdIZ3ddJdKZ4dLeddfdMdNZ5dee fdOdPZ6ddee d@e+ddfdQdRZ7dSe8dTe9ddfdUdVZ:dWedXeddfdYdZZ;dWefd[d\Z<dWed]ed^e=eee f fd_d`Z>dWefdadbZ?dWedcedeee  fdddeZ@dWedee fdfdgZAeBdhfdWedie+fdjdkZCddWefdldmZDddWefdndoZEdpZFeGeHdq< drZIeGeHds< dtZJeGeHdu< ddvee de9fdwdxZKeLdvedefdydzZMeLd{d|dved}eddfd~dZNdeddfddZOdddZPdS )r   a  Access to configuration values, pluginmanager and plugin hooks.

    :param PytestPluginManager pluginmanager:
        A pytest PluginManager.

    :param InvocationParams invocation_params:
        Object containing parameters regarding the :func:`pytest.main`
        invocation.
    T)frozenc                   @   sv   e Zd ZU dZeedf ed< 	 eee	ee
f   ed< 	 eed< 	 dee deee	ee
f   deddfdd	ZdS )
zConfig.InvocationParamsa  Holds parameters passed during :func:`pytest.main`.

        The object attributes are read-only.

        .. versionadded:: 5.1

        .. note::

            Note that the environment variable ``PYTEST_ADDOPTS`` and the ``addopts``
            ini option are handled by pytest, not being included in the ``args`` attribute.

            Plugins accessing ``InvocationParams`` must be aware of that.
        .rY   rZ   r   rH   Nc                C   s2   t | dt| t | d| t | d| d S )NrY   rZ   r   )object__setattr__tuple)rJ   rY   rZ   r   rC   rC   rD   rK     s   z Config.InvocationParams.__init__)r<   r=   r>   r?   r   rR   __annotations__r   r   r   rE  r   r   rK   rC   rC   rC   rD   r     s"   
 r   c                   @   s,   e Zd ZdZe Ze ZeZe Z	dS )zConfig.ArgsSourcezSIndicates the source of the test arguments.

        .. versionadded:: 7.2
        N)
r<   r=   r>   r?   enumautoARGSINVOCATION_DIRZINCOVATION_DIR	TESTPATHSrC   rC   rC   rD   
ArgsSource  s    rd  Nr   r   r   rH   c                C   s  ddl m} ddl m} |d u r| jdd t d}t | _	 || _		 |}|d| d| d| j
d	d
| _|| _	 t | _	 | j| _| jjjd| _t| jj| _i | _d| _i | _g | _| j| d d| _| jjjt| j| jdd tjj | _!g | _"t#rddl$m%} d | _&d S d S )Nr   )FILE_OR_DIRr2   rC   r   z%(prog)s [options] [z] [z] [...]T)usageZ
processoptZ	_ispytestr_   ZpytestconfigF)parserr   r   r   )Cache)'
argparsingre  r3   r   r   r   argparse	Namespaceoptionr   _processopt_parserr   r.   stash_storer   r   r   r   rk   	_inicache_override_ini	_opt2dest_cleanupr   r   Zpytest_addoptionr   r   r   rd  ra  args_sourcerY   r   Z_pytest.cacheproviderrh  cache)rJ   r   r   re  r3   _arh  rC   rC   rD   rK     sL   



zConfig.__init__c                 C      | j S )znThe path to the :ref:`rootdir <rootdir>`.

        :type: pathlib.Path

        .. versionadded:: 6.1
        )	_rootpathrO   rC   rC   rD   r  C     zConfig.rootpathc                 C   rx  )zThe path to the :ref:`configfile <configfiles>`.

        :type: Optional[pathlib.Path]

        .. versionadded:: 6.1
        )_inipathrO   rC   rC   rD   inipathM  rz  zConfig.inipathfuncc                 C   s   | j | dS )zxAdd a function to be called when the config object gets out of
        use (usually coinciding with pytest_unconfigure).N)rt  r   )rJ   r}  rC   rC   rD   add_cleanupW  s   zConfig.add_cleanupc                 C   s^   | j rJ d| _ t  td | jjjt| dd W d    d S 1 s(w   Y  d S )NTdefaultr^   r   )r   r   catch_warningssimplefilterrk   r   r   r   rO   rC   rC   rD   _do_configure\  s   


"zConfig._do_configurec                 C   sH   | j rd| _ | jj| d g | jj_| jr"| j }|  | jsd S d S )NFr^   )r   rk   Zpytest_unconfigurer   Z_call_historyrt  pop)rJ   ZfinrC   rC   rD   rl   c  s   

zConfig._ensure_unconfigurec                 C   s   | j d}|d usJ |jS )Nterminalreporter)r   r   Z_tw)rJ   r  rC   rC   rD   get_terminal_writerl  s
   zConfig.get_terminal_writerrY   c                 C   s   z|  | W | S  tyB   t| jddsd|v r%ddlm} ||   t| jdds4d|v s4d|v rA| j   t	j
d	  w )
NversionFz	--versionr   )showversionhelpz--helpz-hz8
NOTE: displaying only minimal help due to UsageError.

)parser!   r   rl  Z_pytest.helpconfigr  rn  Z
_getparser
print_helprc   rt   r   )rJ   r   rY   r  rC   rC   rD   r   s  s"   	zConfig.pytest_cmdline_parseexcinforl  c                 C   s   |rt |ddrd}nd}|jdt |dd|d}| jj||d}t|s<t|d	D ]}tj	d
|  tj
  q,d S d S )NZ	fulltraceFlongnativeT
showlocals)Zfuncargsr  r\   )excreprr  r`   zINTERNALERROR> %s
)r   rh   rk   Zpytest_internalerroranyrR   rU   rc   rd   r   ru   )rJ   r  rl  r\   r  resre   rC   rC   rD   notify_exception  s   zConfig.notify_exceptionnodeidc                 C   s*   | j j| jkr| j| }t| j j|}|S rI   )r   r   r  r)   )rJ   r  fullpathrC   rC   rD   cwd_relative_nodeid  s   
zConfig.cwd_relative_nodeidc                 C   sB   t |}|jj| |j|dd |jjD ]}|j| q|S )z$Constructor usable for subprocesses.Faddopts)r   rl  __dict__updater  rZ   r   r   )clsZoption_dictrY   r_   r  rC   rC   rD   fromdictargs  s   zConfig.fromdictargsr1  r1   c                 C   sT   |j |j D ]}|j| j|< qt|dr&t| j|js(t| j|j|j d S d S d S )Nr  )_short_opts
_long_optsdestrs  r+  rl  setattrr  )rJ   r1  r   rC   rC   rD   rm    s   
zConfig._processopt)r   early_configc                 C   sj   |j |jj|jj|d|jj|jdd\}}| jj	||jj|jj
|j|jj|jj|jj|dd d S )N	testpathsFrY   r   r  r  r  r   r  )rY   r   r  r  r  r  r  r  )_decide_argsknown_args_namespacefile_or_dirr   getinir   r   r  r   r  r  r  r  )rJ   r  rY   ru  rC   rC   rD   pytest_load_initial_conftests  s(   

z$Config.pytest_load_initial_conftestsc                 C   s   | j j|t| jd\}}t|j|j| |jpd | jj	d\}}}|| _
|| _|| _t| j| j jd< t| j| j jd< | j ddd | j dd	 | j jd
ddg d |jpZd| _d S )N	namespace)inifilerY   Zrootdir_cmd_argr  rootdirr  r  zExtra command line optionsrY   
minversionz!Minimally required pytest versionrequired_pluginsz.Plugins that must be present for pytest to run)rN   r  rC   )rn  parse_known_and_unknown_argscopyrl  r"   Zinifilenamer  r  r   r   ry  r{  inicfgrR   r  Z
extra_infor|  addiniZoverride_inirr  )rJ   rY   nsunknown_argsr  r|  r  rC   rC   rD   _initini  s.   
zConfig._initinic                 C   sl   | j |\}}t|dd}|dkr/ddl}z|j| }W n ty)   d}Y nw | | | | dS )zInstall the PEP 302 import hook if using assertion rewriting.

        Needs to parse the --assert=<mode> option from the commandline
        and find all the installed plugins to mark them for rewriting
        by the importhook.
        Z
assertmodeplainZrewriter   N)	rn  r  r   r   r   Zinstall_importhookSystemError_mark_plugins_for_rewrite_warn_about_missing_assertion)rJ   rY   r  r  r   r   rk   rC   rC   rD   _consider_importhook  s   
zConfig._consider_importhookc                 C   sH   || j _tjdrdS dd tj D }t|D ]}|	| qdS )zGiven an importhook, mark for rewrite any top-level
        modules or packages in the distribution package for
        all pytest plugins.PYTEST_DISABLE_PLUGIN_AUTOLOADNc                 s   s<    | ]}t d d |jD r|jpg D ]}t|V  qqdS )c                 s   s    | ]}|j d kV  qdS )r;  N)group)r   eprC   rC   rD   	<genexpr>  s    z=Config._mark_plugins_for_rewrite.<locals>.<genexpr>.<genexpr>N)r  entry_pointsfilesrR   )r   distfilerC   rC   rD   r  	  s    z3Config._mark_plugins_for_rewrite.<locals>.<genexpr>)
r   r   rV   r   r   rT   metadatadistributionsrT  r?  )rJ   rk   rM  r   rC   rC   rD   r    s   z Config._mark_plugins_for_rewriteviac                 C   s6   || j _z| j j|t| jd W | j `|S | j `w )zValidate known args.r  )rn  Z_config_source_hintr  r  rl  )rJ   rY   r  rC   rC   rD   _validate_args  s   zConfig._validate_argsr   r  r  r  r   c                C   s   |rt jj}|}||fS ||kr>t jj}|r|}n'g }|D ]}	|ttj|	dd q|r=|s=|r=d}
| jt	|
dd ng }|sKt jj
}t|g}||fS )zDecide the args (initial paths/nodeids) to use given the relevant inputs.

        :param warn: Whether can issue warnings.

        :returns: The args and the args source. Guaranteed to be non-empty.
        T)	recursivezNo files were found in testpaths; consider removing or adjusting your testpaths configuration. Searching recursively from the current directory instead.r9   
stacklevel)r   rd  ra  rc  extendsortedr  iglobissue_config_time_warningr/   rb  rR   )rJ   rY   r   r  r  r  r   sourceresultrF   warning_textrC   rC   rD   r    s0   
zConfig._decide_argsr  c              
   C   s  |rt jdd}t|r| t|d| |d d < | | |r2| | dd| |d d < | j	j
|t| jd| _|   | | | jj|dd t jd	s\| jd
 | j  | j	j
|t| jd| _|   |   | jjd u r| jd urt| jj}nt| j}|| j_z| jj| || j	d W d S  ty } z| jjs| jjr| j t!d|j" dd n W Y d }~d S d }~ww )NZPYTEST_ADDOPTSr<  zvia PYTEST_ADDOPTSr  zvia addopts configr  Fr   r  r;  )r  rY   rg  z"could not load initial conftests: r8   r  )#rV   r   r   r-  r  shlexrU   r  r  rn  parse_known_argsr  rl  r  _checkversionr  r   r   r@  r7  _validate_plugins_warn_about_skipped_pluginsr  r|  rR   r   r  rk   r  rE   r  r  r  r/   rF   )rJ   rY   r  Zenv_addoptsr  rn   rC   rC   rD   	_preparseL  sX   






zConfig._preparse)wrapperc                 c   s    zd V W |    S |    w rI   )_validate_config_optionsrO   rC   rC   rD   pytest_collection  s   zConfig.pytest_collectionc                 C   sz   dd l }| jdd }|r9ddlm} t|ts |d| j ||||j	kr;|| j d| d|j	 dd S d S )Nr   r  Versionz'%s: 'minversion' must be a single valuez: 'minversion' requires pytest-z, actual pytest-')
r6   r  r   packaging.versionr  r   rR   r!   r|  __version__)rJ   r6   Zminverr  rC   rC   rD   r    s   
	zConfig._checkversionc                 C   s(   t |  D ]}| d| d qd S )NzUnknown config option: r`   )r  _get_unknown_ini_keys_warn_or_fail_if_strict)rJ   keyrC   rC   rD   r    s   zConfig._validate_config_optionsc           
   	   C   s   t | d}|sd S ddlm} ddlm} ddlm} | j }dd |D }g }|D ]4}z||}	W n |yC   |	| Y q-w |	j
|vrO|	| q-|	jj|||	j
 dd	sa|	| q-|rntd
d|d S )Nr  r   )InvalidRequirement)Requirementr  c                 S   s   i | ]	\}}|j |jqS rC   )project_namer  )r   r   r  rC   rC   rD   
<dictcomp>  s    z,Config._validate_plugins.<locals>.<dictcomp>T)prereleaseszMissing required plugins: {}r   )r  r  Zpackaging.requirementsr  r  r  r  r   Zlist_plugin_distinfor   r   	specifiercontainsr!   r   r   )
rJ   r  r  r  r  Zplugin_infoZplugin_dist_infoZmissing_pluginsZrequired_pluginreqrC   rC   rD   r    s8   



zConfig._validate_pluginsr   c                 C   s&   | j jrt|| jt|dd d S )Nr9   r  )r  Zstrict_configr!   r  r/   )rJ   r   rC   rC   rD   r    s   zConfig._warn_or_fail_if_strictc                    s   | j j  fdd| jD S )Nc                    s   g | ]}| vr|qS rC   rC   )r   r   Zparser_inicfgrC   rD   
<listcomp>  s    z0Config._get_unknown_ini_keys.<locals>.<listcomp>)rn  _inidictr  rO   rC   r  rD   r    s   zConfig._get_unknown_ini_keysc                 C   s   | j g ks	J d| jjjt| jdd | j||d d| j_z%| jj	|| j
| j
d}| j|| jj| d| jj| jdd\| _ | _W d S  tyO   Y d S w )	Nz:can only parse cmdline args at most once per Config object)r   r   r  Tr  r  r  )rY   rk   Zpytest_addhooksr   r   r   r  rn  Zafter_preparseZparse_setoptionrl  r  r  r   r  r   r   r  ru  r    )rJ   rY   r  rC   rC   rD   r    s.   

zConfig.parsewarningr  c                 C   s   | j drdS | jjpg }| d}tjdd}tdt| t	|| tj
||d W d   n1 s8w   Y  |rbt|d }|jj|j|jjf}| jjjt|d	 d
d|dd dS dS )a  Issue and handle a warning during the "configure" stage.

        During ``pytest_configure`` we can't capture warnings using the ``catch_warnings_for_item``
        function because it is not possible to have hook wrappers around ``pytest_configure``.

        This function is mainly intended for plugins that need to issue warnings during
        ``pytest_configure`` (or similar stages).

        :param warning: The warning instance.
        :param stacklevel: stacklevel forwarded to warnings.warn.
        r   NfilterwarningsT)recordalwaysr  r   r   r_   r<  )Zwarning_messagewhenr  locationr   )r   r=  r  Zpythonwarningsr  r   r  r  rN   apply_warning_filtersr   rc   	_getframef_codeco_filenamef_linenoco_namerk   Zpytest_warning_recordedr   r   )rJ   r  r  cmdline_filtersconfig_filtersrecordsframer  rC   rC   rD   r    s*   


z Config.issue_config_time_warningr   re   c                 C   s&   |  |}t|tsJ || dS )zAdd a line to an ini-file option. The option must have been
        declared but might not yet be set in which case the line becomes
        the first line in its value.N)r  r   r   r   )rJ   r   re   r  rC   rC   rD   r     s   
zConfig.addinivalue_linec                 C   s8   z| j | W S  ty   | | | j |< }| Y S w )a8  Return configuration value from an :ref:`ini file <configfiles>`.

        If a configuration value is not defined in an
        :ref:`ini file <configfiles>`, then the ``default`` value provided while
        registering the configuration through
        :func:`parser.addini <pytest.Parser.addini>` will be returned.
        Please note that you can even provide ``None`` as a valid
        default value.

        If ``default`` is not provided while registering using
        :func:`parser.addini <pytest.Parser.addini>`, then a default value
        based on the ``type`` parameter passed to
        :func:`parser.addini <pytest.Parser.addini>` will be returned.
        The default values based on ``type`` are:
        ``paths``, ``pathlist``, ``args`` and ``linelist`` : empty list ``[]``
        ``bool`` : ``False``
        ``string`` : empty string ``""``

        If neither the ``default`` nor the ``type`` parameter is passed
        while registering the configuration through
        :func:`parser.addini <pytest.Parser.addini>`, then the configuration
        is treated as a string and a default empty string '' is returned.

        If the specified name hasn't been registered through a prior
        :func:`parser.addini <pytest.Parser.addini>` call (usually from a
        plugin), a ValueError is raised.
        )rq  r  _getini)rJ   r   valrC   rC   rD   r    s   zConfig.getinirN   valuec                 C   s   d| }t ||)Nzunknown configuration type: )rm   )rJ   r   rN   r  rr   rC   rC   rD   _getini_unknown_type4  s   

zConfig._getini_unknown_typec           	   
      sZ  z| j j| \}}}W n ty } ztd||d }~ww | |}|d u r<z| j| }W n ty;   | Y S w |}|dkrd| jd urK| jjn| jj	 t
|trYt|n|} fdd|D S |dkrtt
|trrt|S |S |dkrt
|trdd tdd	 |d
D S |S |dkrtt| S |dkr|S |d u r|S | |||S )Nzunknown configuration value: pathsc                    s   g | ]} | qS rC   rC   )r   r  ZdprC   rD   r  [      z"Config._getini.<locals>.<listcomp>rY   Zlinelistc                 S   s   g | ]}|r|qS rC   rC   )r   trC   rC   rD   r  `  r  c                 S   s   |   S rI   r/  )r  rC   rC   rD   <lambda>`  s    z Config._getini.<locals>.<lambda>r`   r   string)rn  r  r  rm   _get_override_ini_valuer  r|  r   r   r   r   rR   r  rU   map
_strtoboolr/  r  )	rJ   r   descriptionrN   r  rn   Zoverride_valuer  Zinput_valuesrC   r  rD   r  8  sD   


zConfig._getinirF   c                 C   s   z| j ||\}}W n
 ty   Y d S w |jd usJ t|jj}g }|D ]}t|tjr4t|}n|	dtj
}t|| }|| q'|S )NrN  )r   r  r  r%  r   r   r   rV   r   r   rW   r(   r   )rJ   r   rF   r  ZrelrootsmodpathvaluesZrelrootrC   rC   rD   _getconftest_pathlistl  s   
zConfig._getconftest_pathlistc                 C   s`   d }| j D ](}z
|dd\}}W n ty& } z	td|d|d }~ww ||kr-|}q|S )Nr   r   z3-o/--override-ini expects option=value style (got: z).)rr  rU   rm   r!   )rJ   r   r  Z
ini_configr  Zuser_ini_valuern   rC   rC   rD   r  }  s    

zConfig._get_override_ini_valueFskipc              
   C   s   | j ||}zt| j|}|du r|rt||W S  tyI } z#|tur.|W  Y d}~S |r=ddl}|d|d td||d}~ww )ai  Return command line option value.

        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        Nr   zno z option foundzno option named )	rs  r   r   rl  r   notsetr6   r  rm   )rJ   r   r  r  r  rn   r6   rC   rC   rD   	getoption  s   	zConfig.getoptionc                 C   s
   |  |S )z$Deprecated, use getoption() instead.r  rJ   r   rF   rC   rC   rD   getvalue     
zConfig.getvaluec                 C   s   | j |ddS )z-Deprecated, use getoption(skip=True) instead.T)r  r  r  rC   rC   rD   getvalueorskip  r   zConfig.getvalueorskipZ
assertionsVERBOSITY_ASSERTIONSZ
test_casesVERBOSITY_TEST_CASESr`  _VERBOSITY_INI_DEFAULTverbosity_typec                 C   s\   | j j}t|tsJ |du r|S t|}|| jjvr|S | |}|tj	kr*|S t|S )a4  Retrieve the verbosity level for a fine-grained verbosity type.

        :param verbosity_type: Verbosity type to get level for. If a level is
            configured for the given type, that value will be returned. If the
            given type is not a known verbosity type, the global verbosity
            level will be returned. If the given type is None (default), the
            global verbosity level will be returned.

        To configure a level for a fine-grained verbosity type, the
        configuration file should have a setting for the configuration name
        and a numeric value for the verbosity level. A special value of "auto"
        can be used to explicitly use the global verbosity level.

        Example:
        .. code-block:: ini

            # content of pytest.ini
            [pytest]
            verbosity_assertions = 2

        .. code-block:: console

            pytest -v

        .. code-block:: python

            print(config.get_verbosity())  # 1
            print(config.get_verbosity(Config.VERBOSITY_ASSERTIONS))  # 2
        N)
rl  verboser   intr   _verbosity_ini_namern  r  r  r  )rJ   r  Zglobal_levelZini_namelevelrC   rC   rD   get_verbosity  s   


zConfig.get_verbosityc                 C   s
   d|  S )NZ
verbosity_rC   )r  rC   rC   rD   r    r  zConfig._verbosity_ini_namerg  r3   r  c                 C   s   | j t||dtjd dS )a  Add a output verbosity configuration option for the given output type.

        :param parser: Parser for command line arguments and ini-file values.
        :param verbosity_type: Fine-grained verbosity category.
        :param help: Description of the output this type controls.

        The value should be retrieved via a call to
        :py:func:`config.get_verbosity(type) <pytest.Config.get_verbosity>`.
        r  )r  rN   r  N)r  r   r  r  )rg  r  r  rC   rC   rD   _add_verbosity_ini  s   
zConfig._add_verbosity_inir   c                 C   s2   t  s|dkr
d}nd}| jt|dd d S d S )Nr  zRASSERTIONS ARE NOT EXECUTED and FAILING TESTS WILL PASS.  Are you using python -O?zassertions not in test modules or plugins will be ignored because assert statements are not executed by the underlying Python interpreter (are you using python -O?)
r9   r  )_assertion_supportedr  r/   )rJ   r   r  rC   rC   rD   r    s   
z$Config._warn_about_missing_assertionc                 C   s4   | j jD ]\}}| jtd|d| dd qd S )Nzskipped plugin rL   r8   r  )r   r   r  r/   )rJ   rW  rr   rC   rC   rD   r    s   z"Config._warn_about_skipped_pluginsrD  rI   )rH   r   )r1  r1   rH   N)r  r   rH   N)T)Qr<   r=   r>   r?   r   dataclasses	dataclassr   r_  Enumrd  r   r   rK   propertyr   r  r|  r   r~  r  rl   r%   r  r   rR   r   r#   r   rj  rk  r  r  classmethodr  rm  hookimplr  r   r  r  r  r  r   r   r  r  r   r[  r  r  r  r  r  r  r  Warningr  r  r   r  r   r  r  r  r  r  r  r  r  r  r
   r^  r  r  r  r   r  r  r  r  rC   rC   rC   rD   r     s   
 

!
B		

	


	
	
-6


!#"$4-c                   C   s   zJ  t y   Y dS w )NFT)r$  rC   rC   rC   rD   r     s
   r   r_   r  c                 C   s\   t |d}| jjdkrd|_n	| jjdkrd|_| jjdkr#d|_|S | jjdkr,d|_|S )zCreate a TerminalWriter instance configured according to the options
    in the config object.

    Every code which requires a TerminalWriter object and has access to a
    config object should use this function.
    )r  yesTnoF)r%   rl  colorZ	hasmarkupZcode_highlight)r_   r  rp   rC   rC   rD   create_terminal_writer  s   
	r+  r  c                 C   s.   |   } | dv r
dS | dv rdS td| )a  Convert a string representation of truth to True or False.

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.

    .. note:: Copied from distutils.util.
    )yr(  r  trueon1T)r0  r)  ffalseoff0Fzinvalid truth value )lowerrm   )r  rC   rC   rD   r	  5  s   	r	  2   )maxsizer2  escapezwarnings._ActionKindc             
   C   s  d}t d|  d}| d}t|dkr,d}t dt| d| d	}t|j|d
t|dk r=|d t|dk s2dd |D \}}}	}
}zt|}W n tjyh } zt|jt	|d
dd}~ww zt
|	}W n ty   t }|jdd}t|j|d
dw |r|rt|}|
r|rt|
d }
|rzt|}|dk rtdW n ty } zt|jd|d| d
dd}~ww d}||||
|fS )zParse a warnings filter string.

    This is copied from warnings._setoption with the following changes:

    * Does not apply the filter.
    * Escaping is optional.
    * Raises UsageError so we get nice error messages on failure.
    TzF        while parsing the following warning configuration:

          z8

        This error occurred:

        {error}
        :r;   zJhttps://docs.python.org/3/library/warnings.html#describing-warning-filtersz            Too many fields (z), expected at most 5 separated by colons:

              action:message:category:module:line

            For more information please consult: z
            )errorr<  c                 s   s    | ]}|  V  qd S rI   r  )r   srC   rC   rD   r  r  s    z'parse_warning_filter.<locals>.<genexpr>Nr  )r\   z\Zr   znumber is negativezinvalid lineno rL   )r   rU   r-  r!   r   r   r   
_getaction_OptionErrorrR   _resolve_warning_categoryrQ   r#   Zfrom_currentrh   rer7  r  rm   )r2  r7  __tracebackhide__Zerror_templaterY  Zdoc_urlr9  Zaction_r   Z	category_moduleZlineno_actionrn   categoryro   Zexception_textlinenorC   rC   rD   parse_warning_filterG  sn   
	

rD  rB  c                 C   sr   d}| st S d| vrddl}| }n| d\}}}t|dd|g}t||}t|t s2t| dttt  |S )z
    Copied from warnings._getcategory, but changed so it lets exceptions (specially ImportErrors)
    propagate so we can get access to their tracebacks (#9218).
    T.r   Nz is not a Warning subclass)	r'  builtins
rpartitionrA  r   
issubclassr!   r   r   )rB  r?  r   klassr@  r   catrC   rC   rD   r=    s   

r=  r  r  c                 C   s<   | D ]}t jt|dd  q|D ]}t jt|dd  qdS )z8Applies pytest-configured filters to the warnings moduleF)r7  TN)r   r  rD  )r  r  r2  rC   rC   rD   r    s
   r  )NN)rH   r   rI   )r?   rj  collections.abcrI  r  r!  r_  	functoolsr   r  importlib.metadatarT   r   rV   pathlibr   r>  r  rc   textwrapr   r   r   typingr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zpluggyr   r   r   r   r   compatr   
exceptionsr    r!   Z	findpathsr"   Z_pytest._coder   r#   r$   Z_pytest._ior%   Z_pytest.deprecatedZ_pytest.hookspecZ_pytest.outcomesr&   r'   Z_pytest.pathlibr(   r)   r*   r+   r,   r-   Z_pytest.stashr.   Z_pytest.warning_typesr/   r0   ri  r1   r3   Z_pytest._code.coder4   Z_pytest.terminalr5   r[  rE  r&  r   IntEnumr7   rQ   rE   _codeZTracebackEntryr   rX   rR   r  rs   r}   r~   r   r   r4  r   r   r>  r"  r   r   ra   r   r   r   r   r9  rK  r  rT  r   r   r+  r	  r'  rD  r=  r  rC   rC   rC   rD   <module>   s  	


2	






 


    e
A      U

G