
    	h                        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	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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l0Z.ddl1m2Z2 ddl1m3Z3 ddl4m5Z5 dd l-m6Z6 dd!l-m7Z7 dd"l8m9Z9 dd#l:m;Z; dd$l:m<Z< dd%l=m>Z> dd&l=m?Z? dd'l@mAZA dd(l@mBZB dd)l@mCZC dd*l@mDZD dd+l@mEZE dd,l@mFZF dd-lGmHZH dd.lImJZJ dd/lImKZK e'rdd0lLmMZM dd1lNmOZO dd2lPmQZQ eRZS	  e*d3          ZT e+d3          ZUe; G d4 d5ejV                              ZW G d6 d7eX          ZYd8e.jZ        j[        d9e\fd:Z]	 	 dd;e!e(e e^         d<f                  d=e!e"e(e^eSf                           d9e(e_eWf         fd>Z`d9e_fd?Za G d@ dA          ZbdBe^dCe^d9e^fdDZcdBe^dCe^d9e^fdEZddFZeeedGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^gejf        d_k    rd`dagng dbR z   Zg eheg          Zieij                    dc           eij                    dd           	 	 dd;e!e e^                  d=e!e"e(e^eSf                           d9defdfZkddhZl	 	 dd;e!e(e e^         d<f                  d=e!e"e(e^eSf                           d9defdiZmdBed9efdjZndkedle^dme%e^dnf         d9ee^e\f         fdoZoe; G dp dge,                      Zpdqe(dejq        e^e"e^         f         d9e e^         fdrZrdse^d9dfdtZs G du dv          Zt et            Zudwee^         d9ee^         fdxZve; G dy de                      Zwd9e\fdzZx	 dd{ewd|e!e$         d9e9fd}Zyd~e^d9e\fdZz ed          de^de\d9e%de^e&e{         e^e_f         fd            Z|de^d9e&e{         fdZ}dee^         dee^         d9dfdZ~dS )z:Command line options, ini-file and conftest.py processing.    N)	lru_cache)Path)dedent)FunctionType)TracebackType)Any)Callable)cast)Dict)	Generator)IO)Iterable)Iterator)List)Optional)Sequence)Set)TextIO)Tuple)Type)TYPE_CHECKING)Union)HookimplMarker)HookspecMarker)PluginManager   )	PrintHelp)
UsageError)determine_setup)ExceptionInfo)filter_traceback)TerminalWriter)final)importlib_metadata)fail)Skipped)absolutepath)bestrelpath)import_path)
ImportMode)resolve_package_path)safe_exists)Stash)PytestConfigWarning)warn_explicit_for)_TracebackStyle)TerminalReporter)Argumentpytestc                   *    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__OKTESTS_FAILEDINTERRUPTEDINTERNAL_ERRORUSAGE_ERRORNO_TESTS_COLLECTED     d/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/_pytest/config/__init__.pyr5   r5   U   s;          
BLKNKrE   r5   c                   V     e Zd Zdedeee         eef         ddf fdZde	fdZ
 xZS )ConftestImportFailurepathexcinforeturnNc                 h    t                                          ||           || _        || _        d S N)super__init__rI   rJ   )selfrI   rJ   	__class__s      rF   rO   zConftestImportFailure.__init__m   s1    
 	w'''	rE   c                 p    d                     | j        d         j        | j        d         | j                  S )Nz{}: {} (from {})r   r   )formatrJ   r:   rI   rP   s    rF   __str__zConftestImportFailure.__str__v   s2    !((LO$dl1oty
 
 	
rE   )r:   r;   r<   r   r   r   	Exceptionr   rO   strrU   __classcell__rQ   s   @rF   rH   rH   l   s         tI	=@A 
	     
 
 
 
 
 
 
 
 
rE   rH   entryrK   c                     t          |           o2d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!   rW   rI   splitossep)rZ   s    rF   ,filter_traceback_for_conftest_import_failurer`   |   s6     E""W{#ej//:O:OPRPV:W:W'WWrE   argszos.PathLike[str]pluginsc                    	 	 t          | |          }	 |j                            |          }	 t          |          |                                 S # t
          $ r |cY |                                 S w xY w# |                                 w xY w# t          $ r}t          j        |j	                  }t          t          j                  }|                    d|j         dd           |j                            t"                    |_        |j        r|                    dd          n|                                }t)          |          }|                                D ]+}	|                    |	                                d           ,t          j        cY d	}~S d	}~ww xY w# t0          $ rT}t          t          j                  }|j        D ]}
|                    d
|
 dd           t          j        cY d	}~S d	}~ww xY 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.
    configz$ImportError while loading conftest 'z'.T)redshortF)stylechainNzERROR: 
)_prepareconfighookpytest_cmdline_mainr5   _ensure_unconfigure
ValueErrorrH   r    from_exc_inforJ   r"   sysstderrlinerI   	tracebackfilterr`   getreprexconlyrW   
splitlinesrstriprB   r   ra   )ra   rb   re   reteexc_infotwexc_reprformatted_tbrs   msgs              rF   mainr      sU   "$	-#D'22F$	-,2K,K,K! -L - -#C== **,,,, "   JJ**,,,, **,,,,5 % 	( 	( 	($219==H
++BGGE16EEE4GPPP!)!3!:!:<" "H
 %(  we <<<%%'' 
 x==L$//11 1 140000'''''''	(6  $ $ $CJ''6 	1 	1CGG%c%%%4G0000#######	$s|   B A9 A F- A6A9  F- 5A66A9 9BF- F*DF%F* F- %F**F- -
H7A	H HHc                  6   	 t                      } t          j                                         | S # t          $ r^ t          j        t
          j        t
          j                  }t          j	        |t          j        
                                           Y dS w xY w)zoThe CLI entry point of pytest.

    This function is not meant for programmable use; use `main()` instead.
    r   )r   rq   stdoutflushBrokenPipeErrorr^   opendevnullO_WRONLYdup2fileno)coder   s     rF   console_mainr      s    	vv
    '"*bk22
**,,---qqs   -0 A$BBc                   $    e Zd Z ee          ZdS )cmdlineN)r:   r;   r<   staticmethodr   rD   rE   rF   r   r      s        <DDDrE   r   rI   optnamec                 l    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: r^   rI   isdirr   rI   r   s     rF   filename_argr      s<     
w}}T IGGGGGHHHKrE   c                 l    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   s     rF   directory_argr      s<     7== JGHH$HHIIIKrE   )markr   runnerfixtures
helpconfigpythonterminal	debuggingunittestcaptureskipping
legacypathtmpdirmonkeypatchrecwarnpastebinnose	assertionjunitxmldoctestcacheproviderfreeze_support	setuponly	setupplanstepwisewarningsloggingreportspython_path)r7      unraisableexceptionthreadexceptionfaulthandlerpytesterpytester_assertionsConfigc           	         t                      }t          |t                              | pd|t          j                                        }| |                    | d           t          D ]}|                    |           |S )NrD   ra   rb   dirinvocation_paramsTexclude_only)PytestPluginManagerr   InvocationParamsr   cwdconsider_preparsedefault_pluginsimport_plugin)ra   rb   pluginmanagerre   specs        rF   
get_configr     s    
 ())M 11

 2 
 
  F ''4'@@@ * *##D))))MrE   r   c                  (    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   rD   rE   rF   get_plugin_managerr   )  s     <<%%rE   c                 ^   | t           j        dd          } nwt          | t          j                  rt          j        |           g} nGt          | t                    s2d}t          |                    | t          |                               t          | |          }|j        }	 |rE|D ]B}t          |t                    r|                    |           -|                    |           C|j                            ||           }|S # t"          $ r |                                  w xY w)Nr   zG`args` parameter expected to be a list of strings, got: {!r} (type: {}))r   ra   )rq   argv
isinstancer^   PathLikefspathlist	TypeErrorrS   typer   r   rW   consider_pluginargregisterrl   pytest_cmdline_parseBaseExceptionrn   )ra   rb   r   re   r   plugins         rF   rk   rk   4  sJ    |x|	D"+	&	& 6	$ d## 6U 	 

4d44555g&&F(M 	3! 3 3fc** 3!44V<<<<!**62222#88'd 9 
 
    ""$$$s   'A$D  D,c                 <    |                                  r| j        S | S )z<Get the directory of a path - itself if already a directory.)is_fileparent)rI   s    rF   _get_directoryr   T  s    ||~~ {rE   method	hook_type	opt_names.c                     t           rt          j        |           sJ d t          | dg           D             }g }i }|D ]h}t          | |t                    }|t          ur |                    | d|            d||<   A||v r|                    | d           d||<   cd||<   i|rdd                    |          }t          j        j	        
                    || j        |          }	t          t          t          |           |	           |S )	Nc                     h | ]	}|j         
S rD   name).0ms     rF   	<setcomp>z)_get_legacy_hook_marks.<locals>.<setcomp>d  s    OOOQVOOOrE   
pytestmark=Tz=TrueF, )r   fullname	hook_opts)r   inspect	isroutinegetattrAttributeErrorappendjoin_pytest
deprecatedHOOK_LEGACY_MARKINGrS   r<   r/   r
   r   )
r   r   r   known_marks	must_warnoptsopt_nameopt_attrr   messages
             rF   _get_legacy_hook_marksr   \  sI   
  ) (((((OOWV\2-N-NOOOKID 	# 	#68^<<>))55855666!DNN$$///000!DNN"DNN ?IIi((	$8??( @ 
 

 	$|V44g>>>KrE   c                       e Zd ZdZd/ fdZdedef fdZdef fdZ	 d0dede	e         de	e         f fd	Z
defd
ZdedefdZd1dZdeeeef                  dededede	e         deeef         ddfdZdedefdZdedeeef         deddfdZdedeeef         dedeej                 fdZdededeeef         dedeej        ef         f
dZdedeeef         dedej        fdZdej        deddfdZd d!dee         d"eddfd#Zd$eddfd%Zd&ej        ddfd'Z d/d(Z!dej        ddfd)Z"d*edej        eee         f         ddfd+Z#d2d,ed-eddfd.Z$ xZ%S )3r   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.
    rK   Nc                 F   dd l }t                                          d           t                      | _        i | _        d | _        d| _         t          d          t                    | _	        t                      | _
        g | _        |                     |j                   |                     |            t          j                            d          rt$          j        }t)          |dd          }	 t+          t          j        |                                          |j        d|	          }n# t2          $ r Y nw xY w| j        j                            |j                   |                                  |j                                         | _!        d| _"        d S )
Nr   r3   F   PYTEST_DEBUGencodingutf8r   )mode	bufferingr  )#_pytest.assertionrN   rO   set_conftest_plugins_dirpath2confmods_confcutdir_noconftestr   r   _duplicatepathsskipped_pluginsadd_hookspecshookspecr   r^   environgetrq   rr   r   r   dupr   r  rV   traceroot	setwriterwriteenable_tracingr   DummyRewriteHookrewrite_hook_configured)rP   r   errr  rQ   s       rF   rO   zPytestPluginManager.__init__  s       """ 9< FH+/ 
 -inn^<<*-%% 797+,,,d:>>.)) 	":C#CV<<HF3::<<((%	      JO%%ci000!!! $->>@@ s   7<D4 4
E Er   r   c                     |                     d          sd S |dk    rd S t                                          ||          }||S t          ||          }t	          j        |          sd S t          |dd          S )Npytest_pytest_pluginsimpl)tryfirsttrylastoptionalhookhookwrapper)
startswithrN   parse_hookimpl_optsr   r   r   r   )rP   r   r   r   r   rQ   s        rF   r$  z'PytestPluginManager.parse_hookimpl_opts  s     y)) 	4###4ww**6488K&& (( 	4%FR
 
 	
rE   c                     t                                          ||          }|6t          ||          }|                    d          rt	          |dd          }|S )Nr  r   )firstresulthistoric)rN   parse_hookspec_optsr   r#  r   )rP   module_or_classr   r   r   rQ   s        rF   r(  z'PytestPluginManager.parse_hookspec_opts  sc    ww**?DAA<_d33Fy)) -/ 
 rE   c           
         |t           j        j        v rJt          j        t          d                    |                    dd                                         d S t                      	                    ||          }|r^| j
        j                            t          ||                      t          |t          j                  r|                     |           |S )NzQ{} plugin has been merged into the core, please remove it from your requirements._-)r   managerkwargs)r   r   DEPRECATED_EXTERNAL_PLUGINSr   warnr.   rS   replacerN   r   rl   pytest_plugin_registeredcall_historicdictr   types
ModuleTypeconsider_module)rP   r   r   rz   rQ   s       rF   r   zPytestPluginManager.register  s     7%AAAM#??EvS#..@ @    4"WW--fd;; 	-I.<<64888 =    &%"233 -$$V,,,
rE   c                 0    |                      |          }|S rM   )
get_plugin)rP   r   r   s      rF   	getpluginzPytestPluginManager.getplugin  s    *.//$*?*?rE   c                 F    t          |                     |                    S )z:Return whether a plugin with the given name is registered.)boolr:  )rP   r   s     rF   	haspluginzPytestPluginManager.hasplugin  s    DOOD))***rE   re   r   c                 l    |                     dd           |                     dd           d| _        dS ):meta private: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  )rP   re   s     rF   pytest_configurez$PytestPluginManager.pytest_configure  sX     	G	
 	
 	
 	F	
 	
 	
  rE   ra   pyargs
noconftestrootpath
confcutdir
importmodec                    t          j                    }|rt          ||z            nd| _        || _        || _        d}|D ]p}	t          |	          }
|
                    d          }|dk    r
|
d|         }
t          ||
z            }t          |          r| 	                    |||           d}q|s| 	                    |||           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::T)
r   r   r'   r	  r
  _using_pyargsrW   findr,   _try_load_conftest)rP   ra   rD  rE  rF  rG  rH  currentfoundanchorintitial_pathrI   ianchors                rF   _set_initial_conftestsz*PytestPluginManager._set_initial_conftests  s      (**AKU<*(<===QU%#! 	# 	#M}%%D		$ABwwBQBx!'D.11F 6"" #''
HEEE" 	C##GZBBBBB	C 	CrE   rI   c                 0    | j         dS || j         j        vS )z`Whether a path is within the confcutdir.

        When false, should not load conftest.
        NT)r	  parents)rP   rI   s     rF   _is_in_confcutdirz%PytestPluginManager._is_in_confcutdir8  s#    
 #44+333rE   rR  c                     |                      |||           |                                rC|                    d          D ]/}|                                r|                      |||           .d S d S )Nztest*)_getconftestmodulesis_dirglob)rP   rR  rH  rF  xs        rF   rM  z&PytestPluginManager._try_load_conftestA  s     	  X>>>==?? 	F[[)) F F88:: F,,Q
HEEE	F 	FF FrE   c                    | j         rg S |                     |          }| j                            |          }||S g }t	          |g|j        R           D ]\}|                     |          rE|dz  }|                                r,|                     |||          }	|	                    |	           ]|| j        |<   |S )Nzconftest.py)
r
  r   r  r  reversedrU  rV  r   _importconftestr   )
rP   rI   rH  rF  	directoryexisting_clistclistr   conftestpathmods
             rF   rX  z'PytestPluginManager._getconftestmodulesK  s      	I''--	 /33I>>%!!
 	>I,=>>?? 	& 	&F%%f-- &%5'')) &..|ZRRCLL%%%,1y)rE   c                     |                      |||          }t          |          D ]&}	 |t          ||          fc S # t          $ r Y #w xY wt	          |          )N)rF  )rX  r]  r   r   KeyError)rP   r   rI   rH  rF  modulesrc  s          rF   _rget_with_confmodz&PytestPluginManager._rget_with_confmodf  s     **4h*OOG$$ 	 	CGC......!   tnns   ?
AArb  c                    |                      t          |                    }|t          t          j        |          S t          |          }|t          |j                   	 t          |||          }nC# t          $ r6}|j
        J t          |          ||j
        f}t          ||          |d }~ww xY w|                     ||           | j                            |           |j        }	|	| j        v rI| j                                        D ]/\  }
}|	|
j        v s|
|	k    r||vsJ |                    |           0|                     d|           |                     |           |S )N)r  r  zloading conftestmodule )r:  rW   r
   r6  r7  r+   _ensure_removed_sysmodulestemr)   rV   __traceback__r   rH   _check_non_top_pytest_pluginsr  addr   r  itemsrU  r   r  consider_conftest)rP   rb  rH  rF  existingpkgpathrc  r{   r|   dirpathrI   modss               rF   r^  z#PytestPluginManager._importconftestu  s    ??3|#4#455((333&|44?%l&7888	Gl(KKKCC 	G 	G 	G?...QAO4H'h??QF	G
 	**3===""3'''%d,,,"4::<< % %
ddl**dgood????KK$$$

4S44555s###
s   %A8 8
B81B33B8rc  c                     t          |d          r<| j        r7| j        s2d}t          |                    || j                  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)pytrace)hasattrr  rK  r%   rS   r	  )rP   rc  rb  r   s       rF   rl  z1PytestPluginManager._check_non_top_pytest_plugins  s     C)**	L 	L &	Lw  L$*:;;UKKKKKK	L 	L 	L 	L 	L 	LrE   Fr   r   c                   d}t          |          }||k     r||         }|dz  }t          |t                    r|dk    r!	 ||         }n# t          $ r Y dS w xY w|dz  }n!|                    d          r|dd         }np|                                }|r|                    d          s|                     |           ||k     dS dS )r@  r   r   z-pNr6   no:)lenr   rW   
IndexErrorr#  stripr   )rP   ra   r   rQ  noptpargs          rF   r   z%PytestPluginManager.consider_preparse  s     II!eeq'CFA#s## .$;;#Aw%   FAA^^D)) qrr7DDzz|| (>(> ''---# !eeeeees   A
 

AAargc                 Z   |                     d          r|dd         }|t          v rt          d|z            |dk    r*|                     d           |                     d           |                     |           |                     d          s|                     d|z              dS dS |}| j                            |d	          | j        |= |                     d          s)| j                            d|z   d	          | j        d|z   = |                     |d
           dS )r@  rx  r7   Nzplugin %s cannot be disabledr   r   pytest_stepwiser  rJ  T)consider_entry_points)r#  essential_pluginsr   set_blocked_name2pluginr  r   )rP   r  r   s      rF   r   z&PytestPluginManager.consider_pluginarg  sY   >>%   	@qrr7D((( !?$!FGGG &&  ,,,  !2333T"""??9-- 3  T!1222223 3 D  $$T2..6%d+??9-- <$((T)92>>F))d*:;s$?????rE   conftestmodulec                 >    |                      ||j                   dS )r@  r   N)r   __file__)rP   r  s     rF   ro  z%PytestPluginManager.consider_conftest  s!    n>+BCCCCCrE   c                 j    |                      t          j                            d                     dS )r@  PYTEST_PLUGINSN)_import_plugin_specsr^   r  r  rT   s    rF   consider_envz PytestPluginManager.consider_env  s+    !!"*..1A"B"BCCCCCrE   c                 N    |                      t          |dg                      dS )r@  r  N)r  r   )rP   rc  s     rF   r8  z#PytestPluginManager.consider_module  s)    !!'#/?"D"DEEEEErE   r   c                 X    t          |          }|D ]}|                     |           d S rM   )_get_plugin_specs_as_listr   )rP   r   rb   import_specs       rF   r  z(PytestPluginManager._import_plugin_specs  sA     ,D11" 	, 	,K{++++	, 	,rE   modnamer  c                    t          |t                    sJ d|z              |                     |          s|                     |          dS |t          v rd|z   n|}| j                            |           |r|                     d|          }|rdS 	 t          |           t          j
        |         }|                     ||           dS # t          $ r>}t          d| d|j        d                                        |j                  |d}~wt           $ r.}| j                            ||j        pd	f           Y d}~dS d}~ww xY w)
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   rW   
is_blockedr:  builtin_pluginsr  mark_rewriteload_setuptools_entrypoints
__import__rq   rf  r   ImportErrorra   with_tracebackrk  r&   r  r   r   )rP   r  r  
importspecloadedrc  r{   s          rF   r   z!PytestPluginManager.import_plugin  s    '3'' 	
 	
2W<	
 	
' ??7## 	tw'?'?'KF-4-G-GZ'))W
&&z222  	55jw5OOF 	(z""" +j)CMM#w'''''  	5 	5 	5B7BBqvayBB nQ_--15  	@ 	@ 	@ ''!%+2(>?????????	@s$   C 
E9DE #E		ErK   NrM   )re   r   rK   N)F)&r:   r;   r<   r=   rO   _PluggyPluginrW   r$  r(  r   r   r;  r=  r>  rC  r   r   r   r*   rS  rV  rM  r6  r7  rX  r   r   rg  r^  rl  r   r   ro  r  r8  r  r   rX   rY   s   @rF   r   r   |  sp        3! 3! 3! 3! 3! 3!j
- 
s 
 
 
 
 
 
.
 
 
 
 
 
 
 <@ #+3C=	#     .c    
+c +d + + + +       *#CuS$Y'(#C #C 	#C
 #C TN#C *c/*#C 
#C #C #C #CJ4d 4t 4 4 4 4FF(-c:o(>FJNF	F F F F&+CO&<HL	%"	#   6  #z/*	
  
u$	%    .3CO.DPT		   >LL L 
	L L L L6 <A. . .SM.48.	. . . .2@c @d @ @ @ @4D0@ DT D D D DD D D DF5#3 F F F F F,$ 0#x}DE,	, , , ,#( #(S #( #(RV #( #( #( #( #( #( #( #(rE   specsc                    | g S t          | t          j                  rg S t          | t                    r| r|                     d          ng S t          | t
          j        j                  rt          |           S t          d| z            )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   r6  r7  rW   r]   collectionsabcr   r   r   )r  s    rF   r  r    s    
 }	%)** 	% 1#(0u{{3b0%122 E{{
c
	  rE   r  c                 D    	 t           j        | = d S # t          $ r Y d S w xY wrM   )rq   rf  re  )r  s    rF   ri  ri  0  s9    K      s    
c                       e Zd Zd ZdS )Notsetc                     dS )Nz<NOTSET>rD   rT   s    rF   __repr__zNotset.__repr__8  s    zrE   N)r:   r;   r<   r  rD   rE   rF   r  r  7  s#            rE   r  package_filesc              #   x  K   t          |           } d}| D ]}d|vo|                    d          }|                    d          dk    o|                    d          }|rDt          j                            |          \  }}|dk    r|                    d          sd}|V  |r%t          j                            |          }d}|V  |sig }| D ]K}|                    d          }	d	                    |	dd	                   }
|
r|
                    |
           L|rt          |          E d	{V  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setup__editable__TN)r   endswithcountr^   rI   splitextr#  dirnamer]   r   r   _iter_rewritable_modules)r  	seen_somefnis_simple_module
is_packagemodule_namer+  package_namenew_package_filespartsnew_fns              rF   r  r  ?  s     @ ''MI  b=?R[[-?-?XXc]]a'FBKK,F,F
 
	W--b11NK g%%k.D.D^.T.T% 	!!!! 	7??2..LI C  	1 	1BHHSMMEXXeABBi((F 1!((000 	C/0ABBBBBBBBBBBC C	C 	CrE   c                      e Zd ZdZe ej        d           G d d                                  Z G d dej	                  Z
dd	d
edee         ddfdZedefd            Zedee         fd            Zdeg df         ddfdZdPdZdPdZdefdZd
edee         dd fdZ	 dQdee         deej                 ddfdZdedefdZ e!dRd            Z"dSdZ# e$d           dTd"            Z%de&e         ddfd#Z'de&e         ddfd$Z(dPd%Z)dee         d&edee         fd'Z*dee         d(ee         d)ee         d*ed+ed,e+de,ee         e
f         fd-Z-dUdee         d.e+ddfd/Z. e$d0          de/d1         fd2            Z0dPd3Z1dPd4Z2dPd5Z3d6eddfd7Z4dee         fd8Z5dUdee         d.e+ddfd9Z6d:e7d;e8ddfd<Z9d=ed>eddfd?Z:d=efd@Z;d=edAedBe<eee         f         fdCZ=d=efdDZ>d=edEed+edeee                  fdFZ?d=edee         fdGZ@eAdHfd=edIe+fdJZBdQd=efdKZCdQd=efdLZDdMeddfdNZEdPdOZFdS )Vr   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                       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ZdS )	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.
        .ra   rb   r   rK   Nc                    t                               | dt          |                     t                               | d|           t                               | d|           d S )Nra   rb   r   )object__setattr__tuple)rP   ra   rb   r   s       rF   rO   z Config.InvocationParams.__init__  sX     tVU4[[999tY888tUC00000rE   )r:   r;   r<   r=   r   rW   __annotations__r   r   r   r  r   r   rO   rD   rE   rF   r   r    s         	 	 CHoJ(5m);#<=>>>>-			G		1 3-		1 huS--?'@AB			1
 		1 		1 		1 		1 		1 		1 		1rE   r   c                   l    e Zd ZdZ ej                    Z ej                    Z ej                    ZdS )Config.ArgsSourcezSIndicates the source of the test arguments.

        .. versionadded:: 7.2
        N)	r:   r;   r<   r=   enumautoARGSINCOVATION_DIR	TESTPATHSrD   rE   rF   
ArgsSourcer    sA        	 	 ty{{"DIKK			rE   r  Nr   r   r   rK   c                &   ddl m}m} |)|                     dd t	          j                              }t          j                    | _        	 || _	        	 |} |d| d| d| j
        d	          | _        || _        	 t                      | _        	 | j        | _        dd
lm} | j        j        j                            d          | _         || j        j                  | _        i | _        d| _        i | _        g | _        | j                            | d           d| _        | j        j                            t=          | j        | j                             t>          j         j!        | _"        g | _#        tH          rddl%m&} d | _'        d S d S )Nr   )ParserFILE_OR_DIRrD   r   z%(prog)s [options] [z] [z] [...]T)usage
processopt	_ispytest)PathAwareHookProxyre   pytestconfigF)parserr   r.  r   )Cache)(
argparsingr  r  r   r   r   argparse	Namespaceoptionr   _processopt_parserr   r-   stash_storecompatr  r  r  r  rl   	_inicache_override_ini	_opt2dest_cleanupr   r  pytest_addoptionr4  r5  r   r  r  args_sourcera   r   _pytest.cacheproviderr  cache)rP   r   r   r  r  _ar  r  s           rF   rO   zConfig.__init__  s    	43333333$ $ 5 548:: !6 ! ! (**	
 "3	
 v;;;;;;'
 
 

 +	
 WW
	 j......'-266x@@
&&t'9'>??	)+,.)+24##D.999 	"00t|4;MNNN 	1 	
 	
 	
 ",1!	 	/333333*.DJJJ	/ 	/rE   c                     | j         S )znThe path to the :ref:`rootdir <rootdir>`.

        :type: pathlib.Path

        .. versionadded:: 6.1
        )	_rootpathrT   s    rF   rF  zConfig.rootpath  s     ~rE   c                     | j         S )zThe path to the :ref:`configfile <configfiles>`.

        :type: Optional[pathlib.Path]

        .. versionadded:: 6.1
        )_inipathrT   s    rF   inipathzConfig.inipath	  s     }rE   funcc                 :    | j                             |           dS )zxAdd a function to be called when the config object gets out of
        use (usually coinciding with pytest_unconfigure).N)r  r   )rP   r  s     rF   add_cleanupzConfig.add_cleanup  s      	T"""""rE   c                    | j         rJ d| _         t          j                    5  t          j        d           | j        j                            t          |                      d d d            d S # 1 swxY w Y   d S )NTdefaultrd   r.  )r  r   catch_warningssimplefilterrl   rC  r4  r5  rT   s    rF   _do_configurezConfig._do_configure  s    ####$&& 	O 	O!),,,I&44D<M<M<M4NNN	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	Os   AA44A8;A8c                     | j         r3d| _         | j                            |            g | j        j        _        | j        r,| j                                        } |             | j        *d S d S )NFrd   )r  rl   pytest_unconfigurerC  _call_historyr  pop)rP   fins     rF   rn   zConfig._ensure_unconfigure  s     	:$DI(((55579DI&4m 	-##%%CCEEE m 	 	 	 	 	rE   c                 L    | j                             d          }|J |j        S )Nterminalreporter)r   r:  _tw)rP   r  s     rF   get_terminal_writerzConfig.get_terminal_writer(  s5    7;7I7T7T8
 8
  +++##rE   ra   c                 z   	 |                      |           n# t          $ r t          | j        dd          sd|v rddlm}  ||            nht          | j        dd          sd|v sd|v rJ| j                                                                         t          j
                            d	            w xY w| S )
NversionFz	--versionr   )showversionhelpz--helpz-hz8
NOTE: displaying only minimal help due to UsageError.

)parser   r   r  _pytest.helpconfigr  r  
_getparser
print_helprq   r   r  )rP   r   ra   r  s       rF   r   zConfig.pytest_cmdline_parse/  s    	JJt 	 	 	 t{Iu55 
9L9L::::::D!!!!VU337?47G7G4SW<<''))44666
  Q   !	$ s
    B B8rJ   r  c                    |rt          |dd          rd}nd}|                    dt          |dd          |          }| j                            ||          }t	          |          set          |                              d	          D ]D}t          j        	                    d
|z             t          j        
                                 Cd S d S )N	fulltraceFlongnativeT
showlocals)funcargsr  rh   )excreprrJ   rj   zINTERNALERROR> %s
)r   rv   rl   pytest_internalerroranyrW   r]   rq   rr   r  r   )rP   rJ   r  rh   r  resrs   s          rF   notify_exceptionzConfig.notify_exceptionH  s    
  	gfk599 	%+EEE//gflE&J&JRW " 
 
 i,,Wg,NN3xx 	#G**400 # #
  !6!=>>>
  """"	# 	## #rE   nodeidc                 x    | j         j        | j        k    r$| j        |z  }t          | j         j        |          }|S rM   )r   r   rF  r(   )rP   r  fullpaths      rF   cwd_relative_nodeidzConfig.cwd_relative_nodeidZ  s;    !%66}v-H !7!;XFFFrE   c                     t          |          }|j        j                            |           |                    |d           |j        j        D ]}|j                            |           |S )z$Constructor usable for subprocesses.Faddopts)r   r  __dict__updater  rb   r   r   )clsoption_dictra   re   r[  s        rF   fromdictargszConfig.fromdictargsa  ss     D!!%%k222T5)))& 	7 	7A 33A6666rE   r}  r2   c                     |j         |j        z   D ]}|j        | j        |<   t	          |d          r<t	          | j        |j                  s$t          | j        |j        |j                   d S d S d S )Nr  )_short_opts
_long_optsdestr  rv  r  setattrr  )rP   r}  r   s      rF   r  zConfig._processoptk  s    Ocn4 	, 	,D#&8DN4  3	"" 	<4;11 <SXs{;;;;;	< 	<< <rE   )r   early_configc                 H   |                     |j        j        |j        j        |                    d          |j        j        |j        d          \  }}| j        	                    ||j        j        |j        j
        |j        |j        j        |j        j                   d S )N	testpathsFra   rD  r&  invocation_dirrF  r1  )ra   rD  rE  rF  rG  rH  )_decide_argsknown_args_namespacefile_or_dirrD  getinir   r   rF  r   rS  rE  rG  rH  )rP   r$  ra   r  s       rF   pytest_load_initial_conftestsz$Config.pytest_load_initial_conftestss  s     )552>4;"))+66'9=!* 6 
 
k 	114;#8C!*#8C#8C 	2 	
 	
 	
 	
 	
rE   c                 <   | j                             |t          j        | j                            \  }}t	          |j        |j        |z   |j        pd |           \  }}}|| _        || _	        || _
        t          | j                  | j         j        d<   t          | j                  | j         j        d<   | j                             ddd           | j                             dd	           | j                             d
ddg            |j        pd| _        d S )N	namespace)rootdir_cmd_argre   rootdirinifiler  zExtra command line optionsra   
minversionz!Minimally required pytest versionrequired_pluginsz.Plugins that must be present for pytest to run)r   r  rD   )r  parse_known_and_unknown_argscopyr  r   inifilenamer+  r2  r  r  inicfgrW   rF  
extra_infor  addinioverride_inir  )rP   ra   nsunknown_argsrF  r  r9  s          rF   _initinizConfig._initini  s-   <DDDIdk22 E 
 
L %4NN\)J.$	%
 %
 %
!'6 "-0-?-?	*-0->->	*I'CVLLLL*MNNN<	 	 	
 	
 	
  _2rE   c                 &   | j                             |          \  }}t          |dd          }|dk    rGddl}	 |j                            |           }|                     |           n# t          $ r d}Y nw xY 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.
        
assertmodeplainrewriter   N)	r  r6  r   r  r   install_importhook_mark_plugins_for_rewriteSystemError_warn_about_missing_assertion)rP   ra   r=  r>  r  r   rl   s          rF   _consider_importhookzConfig._consider_importhook  s      <DDTJJLr<119$$$$5(;;DAA ..t4444     	**400000s   A* *A98A9c                     || j         _        t          j                            d          rdS d t          j                    D             }t          |          D ]}|                    |           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              3      K   | ]=}t          d  |j        D                        |j        pg D ]}t          |          V  >dS )c              3   ,   K   | ]}|j         d k    V  dS )r  N)group)r   eps     rF   	<genexpr>z=Config._mark_plugins_for_rewrite.<locals>.<genexpr>.<genexpr>  s)      FFb28z)FFFFFFrE   N)r  entry_pointsfilesrW   )r   distfiles      rF   rO  z3Config._mark_plugins_for_rewrite.<locals>.<genexpr>  s~       
 
FFD4EFFFFF
 
(b	
 
  II
 
 
 
 
 
 
rE   )	r   r  r^   r  r  r$   distributionsr  r  )rP   rl   r  r   s       rF   rE  z Config._mark_plugins_for_rewrite  s     +/':>>:;; 	F
 
*8::
 
 
 -];; 	$ 	$Dd####	$ 	$rE   viac                     || j         _        	 | j                             |t          j        | j                             | j         `n# | j         `w xY w|S )zValidate known args.r/  )r  _config_source_hintr6  r7  r  )rP   ra   rU  s      rF   _validate_argszConfig._validate_args  sg    +.(	1L55	$+ 6 6 6    0000000s   3A	 		ArD  r&  r(  rF  r1  c          	         |rt           j        j        }|}n||k    rt           j        j        }|r|}nlg }|D ]8}	|                    t          t          j        |	d                               9|r*|s(|r&d}
|                     t          |
          d           ng }|s!t           j        j
        }t          |          g}||fS )zDecide the args (initial paths/nodeids) to use given the relevant inputs.

        :param warn: Whether can issue warnings.
        T)	recursivezNo files were found in testpaths; consider removing or adjusting your testpaths configuration. Searching recursively from the current directory instead.r7   
stacklevel)r   r  r  r  extendsortedrZ  iglobissue_config_time_warningr.   r  rW   )rP   ra   rD  r&  r(  rF  r1  sourceresultrI   warning_texts              rF   r)  zConfig._decide_args  s     	/&+FFF))*4 &FFF ) P PfTZ-M-M-M&N&NOOOO  	 	 !\ )
 !:: 3L A Aa ;     /*9n--.v~rE   r  c                    |r_t           j                            dd          }t          |          r0|                     t          j        |          d          |z   |d d <   |                     |           |r1|                     |                     d          d          |z   |d d <   | j	        
                    |t          j        | j                            | _        |                                  |                     |           | j                            |d           t           j                            d	          s| j                            d
           | j                                         | j	        
                    |t          j        | j                            | _        |                                  |                                  | j        j        r&|                     t0          j        j        d           | j        j        A| j        t;          | j        j                  }nt;          | j                  }|| j        _        	 | j         !                    | || j	                   d S # tD          $ rQ}| j        j#        s| j        j$        r-|                     tK          d|j&                   d           n Y d }~d S d }~ww xY w)NPYTEST_ADDOPTSr  zvia PYTEST_ADDOPTSr  zvia addopts configr/  Fr   rJ  r  r6   r[  )r$  ra   r  z"could not load initial conftests: )'r^   r  r  ry  rX  shlexr]   r?  r,  r  parse_known_argsr7  r  r*  _checkversionrH  r   r   r  r  _validate_plugins_warn_about_skipped_pluginsstrictr`  r   r   STRICT_OPTIONrG  r  rW   r   rF  rl   r-  rH   r  r  r.   rI   )rP   ra   r  env_addoptsrG  r{   s         rF   	_preparsezConfig._preparse  s    	*..)92>>K; ''K(@(@BVWW QQQ 	d 	##DKK	$:$:<PQQTXX G %)L$A$ADIdk22 %B %
 %
! 	!!$''',,T,FFFz~~>?? 	G :::FFF'')))$(L$A$ADId&?@@ %B %
 %
! 	   ((***$+ 	**"0Q +    $/7|' !455

 //
3=D%0	I33!T\ 4      % 		 		 		(- 1J1R  ..'(UQV(U(UVV  /    
      			s   "I= =
KAKK)r"  )NNNc              #   :   K   d V  |                                   d S rM   )_validate_config_optionsrT   s    rF   pytest_collectionzConfig.pytest_collection=  s)       	%%'''''rE   c                 F   dd l }| j                            dd           }|r}ddlm} t          |t                    s|                    d| j        z             ||           ||j	                  k    r*|                    | j        d|d|j	        d          d S d S )Nr   r4  Versionz'%s: 'minversion' must be a single valuez: 'minversion' requires pytest-z, actual pytest-')
r3   r9  r  packaging.versionrt  r   rW   r   r  __version__)rP   r3   minverrt  s       rF   rh  zConfig._checkversionD  s    t44 	111111fc** ''=L   wv);!<!<<<'' ***	  	 	 =<rE   c                     t          |                                           D ]}|                     d| d           d S )NzUnknown config option: rj   )r^  _get_unknown_ini_keys_warn_or_fail_if_strict)rP   keys     rF   rp  zConfig._validate_config_options[  sV    $446677 	L 	LC(()J3)J)J)JKKKK	L 	LrE   c                 V   t          |                     d                    }|sd S ddlm} ddlm}m} | j                                        }d |D             }g }|D ]}	  ||          }	n # |$ r |	                    |           Y +w xY w|	j
        |vr|	                    |           N|	j                             |||	j
                           d          s|	                    |           |r5t          d                    d	                    |                              d S )
Nr5  r   rs  )InvalidRequirementRequirementc                 .    i | ]\  }}|j         |j        S rD   )project_namer  )r   r+  rR  s      rF   
<dictcomp>z,Config._validate_plugins.<locals>.<dictcomp>i  s#    WWW4D-t|WWWrE   T)prereleaseszMissing required plugins: {}r   )r^  r,  rv  rt  packaging.requirementsr~  r  r   list_plugin_distinfor   r   	specifiercontainsr   rS   r   )
rP   r5  rt  r~  r  plugin_infoplugin_dist_infomissing_pluginsrequired_pluginreqs
             rF   ri  zConfig._validate_plugins_  s   !$++.@"A"ABB 	F 	.-----JJJJJJJJ(==??WW;WWW/ 	8 	8O!k/22%   &&777 x///&&7777]++(233 ,   8  &&777 	.55dii6P6PQQ  	 	s   !A--B
	B
r   c                     | j         j        rt          |          |                     t	          |          d           d S )Nr7   r[  )r*  strict_configr   r`  r.   )rP   r   s     rF   r{  zConfig._warn_or_fail_if_strict  sG    $2 	&W%%%&&':7'C'CPQ&RRRRRrE   c                 B    | j         j        fd| j        D             S )Nc                     g | ]}|v|	S rD   rD   )r   r   parser_inicfgs     rF   
<listcomp>z0Config._get_unknown_ini_keys.<locals>.<listcomp>  s#    JJJM0I0I0I0I0IrE   )r  _inidictr9  )rP   r  s    @rF   rz  zConfig._get_unknown_ini_keys  s)    -JJJJJJJJrE   c                 .   | j         g k    s
J d            | j        j                            t	          | j                             |                     ||           | j                            | |           d| j        _	        	 | j        
                    || j        | j                  }|                     || j        j        |                     d          | j        j        | j        d	          \  | _         | _        d S # t(          $ r Y d S w xY w)
Nz:can only parse cmdline args at most once per Config object)r   r.  r  )re   ra   Tr/  r&  r'  )ra   rl   pytest_addhooksr4  r5  r   rn  pytest_cmdline_preparser  after_preparseparse_setoptionr  r)  r*  rD  r,  r   r   rF  r  r   )rP   ra   r  s      rF   r  zConfig.parse  s5    IOOOG OO	!//d&8999 	0 	
 	
 	
 	tW---	))D)AAA&*#	<//dkT[ 0  D +/*;*;07++k22#59 +< + +'DIt'''  	 	 	DD	s   	A;D 
DDwarningr\  c                 N   | j                             d          rdS | j        j        pg }|                     d          }t          j        d          5 }t          j        dt          |                     t          ||           t          j
        ||           ddd           n# 1 swxY w Y   |rnt          j        |dz
            }|j        j        |j        |j        j        f}| j        j                            t)          |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 hookwrappers 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   re   r  )warning_messagewhenr  locationr.  )r   r  r*  pythonwarningsr,  r   r  r  r   apply_warning_filtersr1  rq   	_getframef_codeco_filenamef_linenoco_namerl   pytest_warning_recordedr4  r5  )rP   r  r\  cmdline_filtersconfig_filtersrecordsframer  s           rF   r`  z Config.issue_config_time_warning  su    ((44 	F3BHb%566$D111 	:W!(DMM:::!./BBBM'j9999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:
  
	M*q.11E|/AUUHI-;;$+AJ!%	   <     
	 
	s   A	B**B.1B.r   rs   c                     |                      |          }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   )rP   r   rs   r[  s       rF   rB  zConfig.addinivalue_line  s>     KK!T"""""	rE   c                     	 | j         |         S # t          $ r$ |                     |          x| j         |<   }|cY S w xY w)a  Return configuration value from an :ref:`ini file <configfiles>`.

        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.
        )r  re  _getini)rP   r   vals      rF   r,  zConfig.getini  sU    	>$'' 	 	 	)-d););;DN4 3JJJ	s    +==r   valuec                 ,    d| }t          ||          )Nzunknown configuration type: )ro   )rP   r   r   r  r   s        rF   _getini_unknown_typezConfig._getini_unknown_type  s    3T33e$$$rE   c                 V  	 	 | j         j        |         \  }}}n%# t          $ r}t          d|          |d }~ww xY w|                     |          }|,	 | j        |         }n# t          $ r ||cY S |Y dS g cY S w xY w|}|dk    rN| j        J | j        j        	t          |t                    rt          j        |          n|}	fd|D             S |dk    r+t          |t                    rt          j        |          n|S |dk    rEt          |t                    r.d t          d |                    d	                    D             S |S |d
k    r.t          t          |                                                    S |dk    r|S ||S |                     |||          S )Nzunknown configuration value: r  pathsc                     g | ]}|z  S rD   rD   )r   r[  dps     rF   r  z"Config._getini.<locals>.<listcomp>  s    111qBF111rE   ra   linelistc                     g | ]}||S rD   rD   )r   ts     rF   r  z"Config._getini.<locals>.<listcomp>  s    TTTaRSTTTTrE   c                 *    |                                  S rM   r{  )r[  s    rF   <lambda>z Config._getini.<locals>.<lambda>  s     rE   rj   r=  string)r  r  re  ro   _get_override_ini_valuer9  r  r   r   rW   rf  r]   map
_strtoboolr{  r  )
rP   r   descriptionr   r  r{   override_valuer  input_valuesr  s
            @rF   r  zConfig._getini  s   	N)-)>t)D&Kww 	N 	N 	NETEEFFAM	N55d;;!D)   &"NNN<22			 #E  7??<+++$B1;E31G1GR5;u---UL1111L1111V^^)3E3)?)?J5;u%%%UJZ%%% TT3':':EKK<M<M#N#NTTTTV^^c%jj..00111XL\L,,T4???s.    
<7<A% %A?5A?:A?>A?rI   c                    	 | j                             |||                     d          |          \  }}n# t          $ r Y d S w xY w|j        J t          |j                  j        }g }|D ]s}t          |t          j	                  rt          |          }n2|
                    dt          j                  }t          ||z            }|                    |           t|S )NrH  r  )r   rg  	getoptionre  r  r   r   r   r^   r   r2  r_   r'   r   )	rP   r   rI   rF  rc  relrootsmodpathvaluesrelroots	            rF   _getconftest_pathlistzConfig._getconftest_pathlist  s    	 .AAdDNN<88( MC  	 	 	44	|'''s|$$+ 	# 	#G'2;// :w--!//#rv66&w'899MM'""""s   36 
AAc                     d }| j         D ]Y}	 |                    dd          \  }}||k    r|}%# t          $ r(}t          d                    |                    |d }~ww xY w|S )Nr   r   z9-o/--override-ini expects option=value style (got: {!r}).)r  r]   ro   r   rS   )rP   r   r  
ini_configr|  user_ini_valuer{   s          rF   r  zConfig._get_override_ini_value-  s     , 	+ 	+J
+&0&6&6sA&>&>#^ $;;*E     OVV"   	 s   /
A!#AA!Fskipc                 6   | j                             ||          }	 t          | j        |          }||rt	          |          |S # t          $ rG}|t
          ur|cY d}~S |rddl}|                    d|d           t          d|          |d}~ww xY 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 )	r  r  r   r  r   notsetr3   r  ro   )rP   r   r  r  r  r{   r3   s          rF   r  zConfig.getoption@  s     ~!!$--	A$+t,,C{t{$T***J 	A 	A 	Af$$ 97$77788888899q@	As#   )A 
B
BB!2BBc                 ,    |                      |          S )z$Deprecated, use getoption() instead.r  rP   r   rI   s      rF   getvaluezConfig.getvalueX  s    ~~d###rE   c                 0    |                      |d          S )z-Deprecated, use getoption(skip=True) instead.T)r  r  r  s      rF   getvalueorskipzConfig.getvalueorskip\  s    ~~d~...rE   r  c                     t                      s1|dk    rd}nd}|                     t          |          d           d S d S )NrB  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?)
r7   r[  )_assertion_supportedr`  r.   )rP   r  rc  s      rF   rG  z$Config._warn_about_missing_assertion`  sp    #%% 	w( 3  **#L11 +     	 	rE   c           	      ~    | j         j        D ]/\  }}|                     t          d|d|           d           0d S )Nzskipped plugin : r6   r[  )r   r  r`  r.   )rP   r  r   s      rF   rj  z"Config._warn_about_skipped_pluginsu  sg     $ 2 B 	 	K**#$Lk$L$Ls$L$LMM +    	 	rE   r  rM   )rK   r   )r}  r2   rK   N)r$  r   rK   N)T)Gr:   r;   r<   r=   r#   dataclasses	dataclassr   r  Enumr  r   r   rO   propertyr   rF  r  r	   r  r  rn   r"   r  r   rW   r   r    r   r  r  r  r  classmethodr  r  hookimplr-  r   r?  rH  rE  rX  r=  r   r)  rn  r   rq  rh  rp  ri  r{  rz  r  Warningintr`  rB  r,  r   r  r  r  r  r  r  r  r  rG  rj  rD   rE   rF   r   r     s         [$'''1 1 1 1 1 1 1 (' U1B         TY      " 9=	A/ A/ A/*A/ $$45	A/
 
A/ A/ A/ A/F $    X $    X#T 2 #t # # # #
O O O O   $^ $ $ $ $08<S		   8 04# #}-# +,# 
	# # # #$# #        [< < < < Xd
 
 
 
,3Xc] 3t 3 3 3 321# 14 1 1 1 1($ $ $ $(
49 
3 
49 
 
 
 
) 3i) S		)
 9) ) ) ) 
tCy*$	%) ) ) )V9 9d3i 9$ 9$ 9 9 9 9v X$(9-=#> ( ( (  (   .L L L L   @Ss St S S S SKtCy K K K K $s) d d    6! !c !d ! ! ! !FS      3    % %C %c4PS9n@U % % % %4@C 4@ 4@ 4@ 4@l#/3	$t*	   *C HSM    & ,2 A Ac A A A A A0$ $S $ $ $ $/ /3 / / / /# $    *     rE   c                  *    	 J # t           $ r Y dS w xY w)NFT)AssertionErrorrD   rE   rF   r  r  }  s.    u   tts    
re   rS  c                     t          |          }| j        j        dk    rd|_        n| j        j        dk    rd|_        | j        j        dk    rd|_        n| 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.
    )rS  yesTnoF)r"   r  color	hasmarkupcode_highlight)re   rS  r}   s      rF   create_terminal_writerr    s|     
T	"	"	"B}e##			$	$}#u,, 		%	-	-!IrE   r  c                 f    |                                  } | 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)r|  r  ffalseoff0Fzinvalid truth value )lowerro   )r  s    rF   r  r    sJ     ))++C
222t	5	5	5u777888rE   2   )maxsizer  escapezwarnings._ActionKindc          	      t   d}t          d|  d          }|                     d          }t          |          dk    rHd}t          dt          |           d| d	          }t          |                    |
                    t          |          dk     r(|                    d           t          |          dk     (d |D             \  }}}	}
}	 t          j        |          }nG# t          j        $ r5}t          |                    t          |          
                    d}~ww xY w	 t          |	          }nZ# t          $ rM t          j                    }|                    d          }t          |                    |
                    w xY w|r|rt          j        |          }|
r|rt          j        |
          dz   }
|ra	 t#          |          }|dk     rt%          d          n=# t$          $ r.}t          |                    d|d| 
                    d}~ww xY 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}
        :r9   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              3   >   K   | ]}|                                 V  d S rM   r  )r   ss     rF   rO  z'parse_warning_filter.<locals>.<genexpr>  s*      3M3M!AGGII3M3M3M3M3M3MrE   Nr  )rh   z\Zr   znumber is negativezinvalid lineno r  )r   r]   ry  r   rS   r   r   
_getaction_OptionErrorrW   _resolve_warning_categoryrV   r    from_currentrv   rer  r  ro   )r  r  __tracebackhide__error_templater  doc_urlr  action_r   	category_modulelineno_actionr{   categoryr|   exception_textlinenos                     rF   parse_warning_filterr    s    	 	 	 	
 
N IIcNNE
5zzA~~X 	 !%jj 
 3:  
 
 ..U.;;<<<
e**q..R e**q..3M3Mu3M3M3M0GWi>)1)<W)E)E  > > >..SVV.<<===>F";I"F"F F F F -//!)))99..^.DDEEEF  %6 %)G$$ +& +6""U* 
	\\Fzz !5666  	 	 	%%,Ng,N,N1,N,N%OO  	
 7Hff44s=   C) )D-80D((D-1E AF$G6 6
H. )H))H.r  c                 4   d}| st           S d| vrddl}| }n,|                     d          \  }}}t          |dd|g          }t	          ||          }t          |t                     st          | 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
rpartitionr  r   
issubclassr   r
   r   )r  r  r   klassr	  r+  cats          rF   r  r    s    
  
(#..s335vtTE733
!U

Cc7## =C;;;<<<Ws###rE   r  r  c                     | D ]}t          j        t          |d             |D ]}t          j        t          |d             dS )z8Applies pytest-configured filters to the warnings moduleF)r  TN)r   r  r  )r  r  r  s      rF   r  r    sp      J J!5c%!H!H!HIII I I!5c$!G!G!GHHHI IrE   )NN)rK   r   rM   )r=   r  collections.abcr  r7  r  r  rZ  r   r^   r  rf  rq   r6  r   	functoolsr   pathlibr   textwrapr   r   r   typingr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   pluggyr   r   r   _pytest._coder   _pytest.deprecated_pytest.hookspec
exceptionsr   r   	findpathsr   r    r!   _pytest._ior"   _pytest.compatr#   r$   _pytest.outcomesr%   r&   _pytest.pathlibr'   r(   r)   r*   r+   r,   _pytest.stashr-   _pytest.warning_typesr.   r/   _pytest._code.coder0   _pytest.terminalr1   r  r2   r  r  r  r  IntEnumr5   rV   rH   _codeTracebackEntryr=  r`   rW   r  r   r   r   r   r   r  version_infor   r  r  rm  r   r   rk   r   r   r   r7  r  ri  r  r  r  r   r  r  r  r  r  r  r  rD   rE   rF   <module>r/     sS
   @ @              				 				  



                                                                                                                                             ! ! ! ! ! ! ! ! ! ! ! !                         . . . . . . 0 0 0 0 0 0 & & & & & & ' ' ' ' ' ' * * * * * * & & & & & &             - - - - - - ! ! ! ! ! ! $ $ $ $ $ $ ( ( ( ( ( ( ' ' ' ' ' ' ' ' ' ' ' ' & & & & & & 0 0 0 0 0 0 ' ' ' ' ' '       5 5 5 5 5 5 3 3 3 3 3 3 %222222111111$$$$$$  >(##>(##     t|   ,
 
 
 
 
I 
 
 
 X='X	X X X X <@=A/$ /$
5c$667
8/$huS-%789:/$ 3=/$ /$ /$ /$dc    $       s S S     c c      $
1'2 584D4N4N/00TV3'4 5' ' : #o&&   J      ) * * * !%=A 
49
huS-%789:    2& & & & <@=A 
5c$667
8huS-%789:    @ $     S#X 
#t)_	   @ Z( Z( Z( Z( Z(- Z( Z( Z(zu'hsm;<	#Y   ,s t           
 
>CHSM >Chsm >C >C >C >CB y y y y y y y yxd     .2 "6*   09C 9D 9 9 9 9$ 2D5	D5D5
!3WsC?@D5 D5 D5 D5N$ $W $ $ $ $,
ISM
I4<SM
I	
I 
I 
I 
I 
I 
IrE   