
    	h!B              	       `   d 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*m+Z+ e	r
ddl,m-Z- ddl.Z.e G d d                      Z/ G d  d!          Z0eej1         G d" d#                                  Z2 G d$ d%          Z3d&ed'e4d(efd)Z5d&ed(efd*Z6d&e)d(efd+Z7d&ed(efd,Z8d&ed(efd-Z9d&ed(ee         fd.Z:d&ed(efd/Z;d'e4d0e4d1e
e4ee4         f         fd2Z<d&e#d(efd3Z=d&e#d1ed(dfd4Z> ed56          d7ed(dfd8            Z?ed9ed(dfd:            Z@ed;eAd<ed(dfd=            ZBdS )>z?Add backward compatibility support for the legacy py path type.    N)Path)List)Optional)TYPE_CHECKING)Union)SectionWrapper)Cache)final)LEGACY_PATHlegacy_path)Config)hookimpl)PytestPluginManager)check_ispytest)fixture)FixtureRequest)Session)MonkeyPatch)	Collector)Item)Node)HookRecorder)Pytester)	RunResult)TerminalReporter)TempPathFactory)Finalc            	       L   e Zd ZU dZdZej        Zded<   ej        Zded<   dddede	d	d
fdZ
ed	efd            Zed	efd            Zed             Zed             Zej        d             Zed	efd            Zd	efdZdHdZdHdZd	efdZd	efdZd	efdZded	efdZd	efdZd	efdZd	efdZ dIdHdZ!d	efdZ"d	efdZ#dId	efd Z$d!e%d	e&e'e(e)f                  fd"Z*d# Z+d$e,e'e(e)f                  d	e,e(         fd%Z-d& Z.d' Z/d( Z0d)dd*d+e	fd,Z1d	e2fd-Z3d	e2fd.Z4d	e%fd/Z5d	e%fd0Z6dJd2Z7d3 Z8dKd4Z9d5e)d6ed	e&e'e(e)f                  fd7Z:e;j<        e;j<        efd8Z=d
ed9d	e2fd:Z>d	e2fd;Z?d< Z@d
d=d	e2fd>ZA	 dLd@edAeBd	dBfdCZCdLdDedAeBd	dBfdEZDd	efdFZEd	efdGZFd
S )MTestdirz
    Similar to :class:`Pytester`, but this class works with legacy legacy_path objects instead.

    All methods just forward to an internal :class:`Pytester` instance, converting results
    to `legacy_path` objects as necessary.
    Fr   CLOSE_STDINTimeoutExpired	_ispytestpytesterr$   returnNc                2    t          |           || _        d S N)r   	_pytester)selfr%   r$   s      _/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/_pytest/legacypath.py__init__zTestdir.__init__6   s    y!!!!    c                 4    t          | j        j                  S )z-Temporary directory where tests are executed.)r   r)   pathr*   s    r+   tmpdirzTestdir.tmpdir:   s     4>.///r-   c                 4    t          | j        j                  S r(   )r   r)   _test_tmprootr0   s    r+   test_tmprootzTestdir.test_tmproot?   s    4>7888r-   c                     | j         j        S r(   )r)   _requestr0   s    r+   requestzTestdir.requestC   s    ~&&r-   c                     | j         j        S r(   r)   pluginsr0   s    r+   r:   zTestdir.pluginsG   s    ~%%r-   c                     || j         _        d S r(   r9   )r*   r:   s     r+   r:   zTestdir.pluginsK   s    !(r-   c                     | j         j        S r(   )r)   _monkeypatchr0   s    r+   monkeypatchzTestdir.monkeypatchO   s    ~**r-   c                 6    | j                             |          S )z(See :meth:`Pytester.make_hook_recorder`.)r)   make_hook_recorder)r*   pluginmanagers     r+   r@   zTestdir.make_hook_recorderS   s    ~00???r-   c                 4    | j                                         S )zSee :meth:`Pytester.chdir`.)r)   chdirr0   s    r+   rC   zTestdir.chdirW   s    ~##%%%r-   c                 4    | j                                         S )zSee :meth:`Pytester._finalize`.)r)   	_finalizer0   s    r+   finalizezTestdir.finalize[   s    ~'')))r-   c                     |r|                     d          sd|z   }t           | j        j        |g|R i |          S )zSee :meth:`Pytester.makefile`..)
startswithr   r)   makefile)r*   extargskwargss       r+   rJ   zTestdir.makefile_   sV     	s~~c** 	 )C24>23HHHHHHIIIr-   c                 P    t          | j                            |                    S )z"See :meth:`Pytester.makeconftest`.)r   r)   makeconftestr*   sources     r+   rO   zTestdir.makeconftestk   s     4>66v>>???r-   c                 P    t          | j                            |                    S )zSee :meth:`Pytester.makeini`.)r   r)   makeinirP   s     r+   rS   zTestdir.makeinio   s     4>11&99:::r-   rQ   c                 6    | j                             |          S )zSee :meth:`Pytester.getinicfg`.)r)   	getinicfgrP   s     r+   rU   zTestdir.getinicfgs       ~''///r-   c                 P    t          | j                            |                    S )z'See :meth:`Pytester.makepyprojecttoml`.)r   r)   makepyprojecttomlrP   s     r+   rX   zTestdir.makepyprojecttomlw   s     4>;;FCCDDDr-   c                 @    t           | j        j        |i |          S )z See :meth:`Pytester.makepyfile`.)r   r)   
makepyfiler*   rL   rM   s      r+   rZ   zTestdir.makepyfile{   s%    44>4dEfEEFFFr-   c                 @    t           | j        j        |i |          S )z!See :meth:`Pytester.maketxtfile`.)r   r)   maketxtfiler[   s      r+   r]   zTestdir.maketxtfile   s%    54>5tFvFFGGGr-   c                 6    | j                             |          S )z#See :meth:`Pytester.syspathinsert`.)r)   syspathinsertr*   r/   s     r+   r_   zTestdir.syspathinsert   s    ~++D111r-   c                 P    t          | j                            |                    S )zSee :meth:`Pytester.mkdir`.)r   r)   mkdirr*   names     r+   rb   zTestdir.mkdir   s     4>//55666r-   c                 P    t          | j                            |                    S )zSee :meth:`Pytester.mkpydir`.)r   r)   mkpydirrc   s     r+   rf   zTestdir.mkpydir   s     4>11$77888r-   c                 P    t          | j                            |                    S )z"See :meth:`Pytester.copy_example`.)r   r)   copy_examplerc   s     r+   rh   zTestdir.copy_example   s     4>66t<<===r-   configc                 8    | j                             ||          S )zSee :meth:`Pytester.getnode`.)r)   getnode)r*   ri   args      r+   rk   zTestdir.getnode   s    ~%%fc222r-   c                 6    | j                             |          S )z!See :meth:`Pytester.getpathnode`.)r)   getpathnoder`   s     r+   rn   zTestdir.getpathnode   s    ~))$///r-   colitemsc                 6    | j                             |          S )zSee :meth:`Pytester.genitems`.)r)   genitems)r*   ro   s     r+   rq   zTestdir.genitems   s    ~&&x000r-   c                 6    | j                             |          S )zSee :meth:`Pytester.runitem`.)r)   runitemrP   s     r+   rs   zTestdir.runitem   s    ~%%f---r-   c                 (     | j         j        |g|R  S )z&See :meth:`Pytester.inline_runsource`.)r)   inline_runsource)r*   rQ   cmdlineargss      r+   ru   zTestdir.inline_runsource   s    .t~.vDDDDDr-   c                       | j         j        | S )z%See :meth:`Pytester.inline_genitems`.)r)   inline_genitemsr*   rL   s     r+   rx   zTestdir.inline_genitems   s    -t~-t44r-    r:   no_reraise_ctrlcr|   c                (     | j         j        |||dS )z See :meth:`Pytester.inline_run`.r{   )r)   
inline_run)r*   r:   r|   rL   s       r+   r~   zTestdir.inline_run   s(    (t~(75E
 
 
 	
r-   c                 &     | j         j        |i |S )z)See :meth:`Pytester.runpytest_inprocess`.)r)   runpytest_inprocessr[   s      r+   r   zTestdir.runpytest_inprocess   s    1t~14B6BBBr-   c                 &     | j         j        |i |S )zSee :meth:`Pytester.runpytest`.)r)   	runpytestr[   s      r+   r   zTestdir.runpytest   s    't~'8888r-   c                       | j         j        | S )z!See :meth:`Pytester.parseconfig`.)r)   parseconfigry   s     r+   r   zTestdir.parseconfig   s    )t~)400r-   c                       | j         j        | S )z$See :meth:`Pytester.parseconfigure`.)r)   parseconfigurery   s     r+   r   zTestdir.parseconfigure   s    ,t~,d33r-   	test_funcc                 8    | j                             ||          S )zSee :meth:`Pytester.getitem`.)r)   getitem)r*   rQ   funcnames      r+   r   zTestdir.getitem   s    ~%%fh777r-   c                 6    | j                             |          S )zSee :meth:`Pytester.getitems`.)r)   getitemsrP   s     r+   r   zTestdir.getitems   s    ~&&v...r-   c                 <    | j                             |||          S )z"See :meth:`Pytester.getmodulecol`.)
configargswithinit)r)   getmodulecol)r*   rQ   r   r   s       r+   r   zTestdir.getmodulecol   s(    ~**zH + 
 
 	
r-   modcolrd   c                 8    | j                             ||          S )z%See :meth:`Pytester.collect_by_name`.)r)   collect_by_name)r*   r   rd   s      r+   r   zTestdir.collect_by_name   s     ~--fd;;;r-   c                 .     | j         j        ||||fi |S )zSee :meth:`Pytester.popen`.)r)   popen)r*   cmdargsstdoutstderrstdinkws         r+   r   zTestdir.popen   s'     $t~#GVVUIIbIIIr-   timeoutr   c                (     | j         j        |||dS )zSee :meth:`Pytester.run`.r   )r)   run)r*   r   r   r   s       r+   r   zTestdir.run   s    !t~!7G5IIIIr-   c                 6    | j                             |          S )zSee :meth:`Pytester.runpython`.)r)   	runpython)r*   scripts     r+   r   zTestdir.runpython   rV   r-   c                 6    | j                             |          S )z!See :meth:`Pytester.runpython_c`.)r)   runpython_c)r*   commands     r+   r   zTestdir.runpython_c   s    ~))'222r-   )r   c                &     | j         j        |d|iS )z*See :meth:`Pytester.runpytest_subprocess`.r   )r)   runpytest_subprocess)r*   r   rL   s      r+   r   zTestdir.runpytest_subprocess   s    2t~2DJ'JJJr-         $@stringexpect_timeoutzpexpect.spawnc                 :    | j                             ||          S )z"See :meth:`Pytester.spawn_pytest`.r   )r)   spawn_pytest)r*   r   r   s      r+   r   zTestdir.spawn_pytest   s     ~**6.*QQQr-   cmdc                 :    | j                             ||          S )zSee :meth:`Pytester.spawn`.r   )r)   spawn)r*   r   r   s      r+   r   zTestdir.spawn   s    ~##C#GGGr-   c                     d| j         dS )Nz	<Testdir >)r1   r0   s    r+   __repr__zTestdir.__repr__   s    +4;++++r-   c                 *    t          | j                  S r(   )strr1   r0   s    r+   __str__zTestdir.__str__   s    4;r-   )r&   Nr(   )r   )rz   F)r   )G__name__
__module____qualname____doc____test__r   r!   __annotations__r"   boolr,   propertyr   r1   r4   r7   r:   setterr   r>   r   r@   rC   rF   rJ   rO   rS   r   r   rU   rX   rZ   r]   r_   rb   rf   rh   r   r   r   r   r   rk   rn   r   rq   rs   ru   rx   r~   r   r   r   r   r   r   r   r   r   
subprocessPIPEr   r   r   r   r   floatr   r   r   r   rz   r-   r+   r    r    (   s          H#/K///&5NG555@E " " " " "$ " " " " 0 0 0 0 X0 9k 9 9 9 X9 ' ' X' & & X& ^) ) ^) +[ + + + X+@< @ @ @ @& & & &* * * *
J 
J 
J 
J 
J@k @ @ @ @; ; ; ; ;0 0 0 0 0 0E; E E E EG[ G G G GHk H H H H2 2 2 2 27[ 7 7 7 79{ 9 9 9 9> > > > > >3f 3huT9_7M.N 3 3 3 30 0 01eD)O&<!= 1$t* 1 1 1 1. . .E E E5 5 5 )+U 
 
 
d 
 
 
 
Ci C C C C9I 9 9 9 91F 1 1 1 14v 4 4 4 48 8 8 8/ / /
 
 
 
<<'*<	%i(	)< < < < 	J 	J 	J 	J %) J J J	 J J J J09 0 0 0 03 3 3 37 K K K9 K K K K
 48R RR+0R	R R R RH H He H H H H H,# , , , ,             r-   r    c                   >    e Zd Zeededefd                        ZdS )LegacyTestdirPluginr%   r&   c                 $    t          | d          S )z
        Identical to :fixture:`pytester`, and provides an instance whose methods return
        legacy ``LEGACY_PATH`` objects instead when applicable.

        New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`.
        Tr#   )r    )r%   s    r+   testdirzLegacyTestdirPlugin.testdir  s     x40000r-   N)r   r   r   staticmethodr   r   r    r   rz   r-   r+   r   r     sJ        1( 1w 1 1 1 W \1 1 1r-   r   c                   Z    e Zd ZU dZeed<   dddededdfd	Zddedede	fdZ
de	fdZdS )TempdirFactorya  Backward compatibility wrapper that implements :class:`py.path.local`
    for :class:`TempPathFactory`.

    .. note::
        These days, it is preferred to use ``tmp_path_factory``.

        :ref:`About the tmpdir and tmpdir_factory fixtures<tmpdir and tmpdir_factory>`.

    _tmppath_factoryFr#   tmppath_factoryr$   r&   Nc                2    t          |           || _        d S r(   )r   r   )r*   r   r$   s      r+   r,   zTempdirFactory.__init__  s      	y!!! /r-   Tbasenamenumberedc                 v    t          | j                            ||                                                    S )zTSame as :meth:`TempPathFactory.mktemp`, but returns a :class:`py.path.local` object.)r   r   mktempresolve)r*   r   r   s      r+   r   zTempdirFactory.mktemp#  s/    4077(KKSSUUVVVr-   c                 r    t          | j                                                                                  S )zYSame as :meth:`TempPathFactory.getbasetemp`, but returns a :class:`py.path.local` object.)r   r   getbasetempr   r0   s    r+   r   zTempdirFactory.getbasetemp'  s+    40<<>>FFHHIIIr-   )T)r   r   r   r   r   r   r   r,   r   r   r   r   rz   r-   r+   r   r     s           &%%% FK0 0 0.0>B0	0 0 0 0W Ws Wd Wk W W W WJ[ J J J J J Jr-   r   c                       e Zd Ze ed          dedefd                        Zeedede	fd                        Z
dS )	LegacyTmpdirPluginsession)scoper7   r&   c                     | j         j        S )zFReturn a :class:`pytest.TempdirFactory` instance for the test session.)ri   _tmpdirhandler)r7   s    r+   tmpdir_factoryz!LegacyTmpdirPlugin.tmpdir_factory-  s    
 ~,,r-   tmp_pathc                      t          |           S )a  Return a temporary directory path object which is unique to each test
        function invocation, created as a sub directory of the base temporary
        directory.

        By default, a new base temporary directory is created each test session,
        and old bases are removed after 3 sessions, to aid in debugging. If
        ``--basetemp`` is used then it is cleared each session. See :ref:`base
        temporary directory`.

        The returned object is a `legacy_path`_ object.

        .. note::
            These days, it is preferred to use ``tmp_path``.

            :ref:`About the tmpdir and tmpdir_factory fixtures<tmpdir and tmpdir_factory>`.

        .. _legacy_path: https://py.readthedocs.io/en/latest/path.html
        r   )r   s    r+   r1   zLegacyTmpdirPlugin.tmpdir4  s    * 8$$$r-   N)r   r   r   r   r   r   r   r   r   r   r1   rz   r-   r+   r   r   ,  s        W9- -> - - -  \-
 % %+ % % % W \% % %r-   r   r*   rd   r&   c                 F    t          |                     |                    S )z{Return a directory path object with the given name.

    Same as :func:`mkdir`, but returns a legacy py path instance.
    )r   rb   rc   s     r+   Cache_makedirr   L  s    
 tzz$''(((r-   c                 *    t          | j                  S )zO(deprecated) The file system path of the test module which collected this test.r   r/   r0   s    r+   FixtureRequest_fspathr   T      ty!!!r-   c                 *    t          | j                  S )zThe directory from which pytest was invoked.

    Prefer to use ``startpath`` which is a :class:`pathlib.Path`.

    :type: LEGACY_PATH
    r   	startpathr0   s    r+   TerminalReporter_startdirr   Y       t~&&&r-   c                 N    t          t          | j        j                            S )zThe directory from which pytest was invoked.

    Prefer to use :attr:`invocation_params.dir <InvocationParams.dir>`,
    which is a :class:`pathlib.Path`.

    :type: LEGACY_PATH
    )r   r   invocation_paramsdirr0   s    r+   Config_invocation_dirr   c  s      s41566777r-   c                 D    t          t          | j                            S )zThe path to the :ref:`rootdir <rootdir>`.

    Prefer to use :attr:`rootpath`, which is a :class:`pathlib.Path`.

    :type: LEGACY_PATH
    )r   r   rootpathr0   s    r+   Config_rootdirr   n  s     s4=))***r-   c                 V    | j         r!t          t          | j                             ndS )zThe path to the :ref:`configfile <configfiles>`.

    Prefer to use :attr:`inipath`, which is a :class:`pathlib.Path`.

    :type: Optional[LEGACY_PATH]
    N)inipathr   r   r0   s    r+   Config_inifiler   x  s(     .2\C;s4<(()))tCr-   c                 *    t          | j                  S )zThe path from which pytest was invoked.

    Prefer to use ``startpath`` which is a :class:`pathlib.Path`.

    :type: LEGACY_PATH
    r   r0   s    r+   Session_stardirr     r   r-   typevaluec                     |dk    rN| j         J | j         j        t          |t                    rt	          j        |          n|}fd|D             S t          d| |          )Npathlistc                 N    g | ]!}t          t          |z                      "S rz   )r   r   ).0xdps     r+   
<listcomp>z/Config__getini_unknown_type.<locals>.<listcomp>  s+    ???QCQKK((???r-   zunknown configuration type: )r   parent
isinstancer   shlexsplit
ValueError)r*   rd   r   r   input_valuesr   s        @r+   Config__getini_unknown_typer    s~     z|'''\ -7s-C-CNu{5)))????,????>>>FFFr-   c                 *    t          | j                  S )z4(deprecated) returns a legacy_path copy of self.pathr   r0   s    r+   Node_fspathr    r   r-   c                 .    t          |          | _        d S r(   )r   r/   )r*   r   s     r+   Node_fspath_setr    s    UDIIIr-   T)tryfirstearly_configc                    t                      }|                     |j                   |                    t          dt
          d           |                    t          dt          t                    d           |                    t          dt          t                    d           |                    t          dt          t                    d           |                    t          dt          t                    d           |                    t          dt          t                    d           |                    t          dt          t                     d           |                    t          d	t"                     |                    t$          dt          t&          t(                    d           d
S )zLMonkeypatch legacy path attributes in several classes, as early as possible.makedirFraisingfspathstartdirinvocation_dirrootdirinifile_getini_unknown_typeN)r   add_cleanupundosetattrr	   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r  r  )r  mps     r+   pytest_load_initial_conftestsr    sj    
BRW%%% JJuiJ>>> JJ~x2G)H)HRWJXXX JJ*h/H&I&ISX    
 JJv'2G)H)HRWJXXXJJvy(>":":EJJJJJJvy(>":":EJJJJ JJw
H_$=$=uJMMM JJv-/JKKK JJtXx_EEuJUUUUUr-   ri   c                 T   | j                             d          rt                      }|                     |j                   	 | j        }t          |d          }|                    | d|d           n# t          $ r Y nw xY w| j         	                    t          d           dS dS )	zKInstalls the LegacyTmpdirPlugin if the ``tmpdir`` plugin is also installed.r1   Tr#   r   Fr  zlegacypath-tmpdirN)rA   
has_pluginr   r  r  _tmp_path_factoryr   r  AttributeErrorregisterr   )ri   r  tmp_path_factoryr   s       r+   pytest_configurer    s     &&x00 O]]27###	P%7
 ,,<MMMNJJv/JOOOO  	 	 	D	 	%%&8:MNNNNN#O Os   A6 6
BBpluginmanagerc                     | |                     d          u }|r7|                    t                    s|                    t          d           d S d S d S )Nr%   zlegacypath-pytester)
get_pluginis_registeredr   r  )r  r   is_pytesters      r+   pytest_plugin_registeredr%    sr     G..z:::K E7001DEE E,.CDDDDDE E E Er-   )Cr   dataclassesr   r   pathlibr   typingr   r   r   r   	iniconfigr   _pytest.cacheproviderr	   _pytest.compatr
   r   r   _pytest.configr   r   r   _pytest.deprecatedr   _pytest.fixturesr   r   _pytest.mainr   _pytest.monkeypatchr   _pytest.nodesr   r   r   _pytest.pytesterr   r   r   _pytest.terminalr   _pytest.tmpdirr   typing_extensionsr   pexpectr    r   	dataclassr   r   r   r   r   r   r   r   r   r   r  r  r  r  r  objectr%  rz   r-   r+   <module>r9     sF   E E                                              $ $ $ $ $ $ ' ' ' ' ' '             & & & & & & & & & & & & ! ! ! ! ! ! # # # # # # . . . . . . - - - - - - $ $ $ $ $ $ + + + + + +             + + + + + + # # # # # #             ) ) ) ) ) ) % % % % % % & & & & & & - - - - - - * * * * * * ''''''NNN U  U  U  U  U  U  U  U p
1 
1 
1 
1 
1 
1 
1 
1 J J J J J J J  J8% % % % % % % %@) )S )[ ) ) ) )" "; " " " "
'$4 ' ' ' ' '8 8; 8 8 8 8+ +K + + + +D DH[$9 D D D D'' 'k ' ' ' '
G
G
G',S$s)^'<
G 
G 
G 
G"d "{ " " " "
$ { t     
4V V4 V V V V> 
OV O O O O 
O, 
EV E6I Ed E E E 
E E Er-   