
    [FiA              	          d Z ddlZddlmZ ddlZddlZddlmZ ddlmZ ddlm	Z	 ddl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-Z-e G d d             Z. G d  d!      Z/eej`                   G d" d#                    Z1 G d$ d%      Z2d&ed'e3d(efd)Z4d&ed(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
e   fd.Z9d&ed(efd/Z:d'e3d0e3d1ee3e	e3   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;e@d<ed(dfd=       ZAy)>z?Add backward compatibility support for the legacy py path type.    N)Path)Final)final)List)Optional)TYPE_CHECKING)Union)SectionWrapper)Cache)LEGACY_PATHlegacy_path)Config)hookimpl)PytestPluginManager)check_ispytest)fixture)FixtureRequest)Session)MonkeyPatch)	Collector)Item)Node)HookRecorder)Pytester)	RunResult)TerminalReporter)TempPathFactoryc            	       .   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dFdZdFd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 dGdFdZ!d	efdZ"d	efdZ#dGd	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Z6dHd1Z7d2 Z8dId3Z9d4e)d5ed	e&e'e(e)f      fd6Z:e;jx                  e;jx                  efd7Z=d
ed8d	e2fd9Z>d	e2fd:Z?d; Z@d
d<d	e2fd=ZA	 dJd>ed?eBd	d@fdAZCdJdBed?eBd	d@fdCZDd	efdDZEd	efdEZFy
)K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                (    t        |       || _        y N)r   	_pytester)selfr%   r$   s      d/var/www/html/BankruptcyAI-uat/bankruptcy-ai/venv/lib/python3.12/site-packages/_pytest/legacypath.py__init__zTestdir.__init__8   s    y!!    c                 @    t        | j                  j                        S )z-Temporary directory where tests are executed.)r   r)   pathr*   s    r+   tmpdirzTestdir.tmpdir<   s     4>>..//r-   c                 @    t        | j                  j                        S r(   )r   r)   _test_tmprootr0   s    r+   test_tmprootzTestdir.test_tmprootA   s    4>>7788r-   c                 .    | j                   j                  S r(   )r)   _requestr0   s    r+   requestzTestdir.requestE   s    ~~&&&r-   c                 .    | j                   j                  S r(   r)   pluginsr0   s    r+   r:   zTestdir.pluginsI   s    ~~%%%r-   c                 &    || j                   _        y r(   r9   )r*   r:   s     r+   r:   zTestdir.pluginsM   s    !(r-   c                 .    | j                   j                  S r(   )r)   _monkeypatchr0   s    r+   monkeypatchzTestdir.monkeypatchQ   s    ~~***r-   c                 8    | j                   j                  |      S )z(See :meth:`Pytester.make_hook_recorder`.)r)   make_hook_recorder)r*   pluginmanagers     r+   r@   zTestdir.make_hook_recorderU   s    ~~00??r-   c                 6    | j                   j                         S )zSee :meth:`Pytester.chdir`.)r)   chdirr0   s    r+   rC   zTestdir.chdirY   s    ~~##%%r-   c                 6    | j                   j                         S r(   )r)   	_finalizer0   s    r+   finalizezTestdir.finalize]   s    ~~''))r-   c                     |r|j                  d      sd|z   }t         | j                  j                  |g|i |      S )zSee :meth:`Pytester.makefile`..)
startswithr   r)   makefile)r*   extargskwargss       r+   rJ   zTestdir.makefile`   sB    s~~c* )C24>>223HHHIIr-   c                 J    t        | j                  j                  |            S )z"See :meth:`Pytester.makeconftest`.)r   r)   makeconftestr*   sources     r+   rO   zTestdir.makeconftestl   s    4>>66v>??r-   c                 J    t        | j                  j                  |            S )zSee :meth:`Pytester.makeini`.)r   r)   makeinirP   s     r+   rS   zTestdir.makeinip   s    4>>11&9::r-   rQ   c                 8    | j                   j                  |      S )zSee :meth:`Pytester.getinicfg`.)r)   	getinicfgrP   s     r+   rU   zTestdir.getinicfgt       ~~''//r-   c                 J    t        | j                  j                  |            S )z'See :meth:`Pytester.makepyprojecttoml`.)r   r)   makepyprojecttomlrP   s     r+   rX   zTestdir.makepyprojecttomlx   s    4>>;;FCDDr-   c                 L    t         | j                  j                  |i |      S )z See :meth:`Pytester.makepyfile`.)r   r)   
makepyfiler*   rL   rM   s      r+   rZ   zTestdir.makepyfile|   s$    44>>44dEfEFFr-   c                 L    t         | j                  j                  |i |      S )z!See :meth:`Pytester.maketxtfile`.)r   r)   maketxtfiler[   s      r+   r]   zTestdir.maketxtfile   s$    54>>55tFvFGGr-   c                 8    | j                   j                  |      S )z#See :meth:`Pytester.syspathinsert`.)r)   syspathinsertr*   r/   s     r+   r_   zTestdir.syspathinsert   s    ~~++D11r-   c                 J    t        | j                  j                  |            S )zSee :meth:`Pytester.mkdir`.)r   r)   mkdirr*   names     r+   rb   zTestdir.mkdir   s    4>>//566r-   c                 J    t        | j                  j                  |            S )zSee :meth:`Pytester.mkpydir`.)r   r)   mkpydirrc   s     r+   rf   zTestdir.mkpydir   s    4>>11$788r-   c                 J    t        | j                  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                 :    | j                   j                  ||      S )zSee :meth:`Pytester.getnode`.)r)   getnode)r*   ri   args      r+   rk   zTestdir.getnode   s    ~~%%fc22r-   c                 8    | j                   j                  |      S )z!See :meth:`Pytester.getpathnode`.)r)   getpathnoder`   s     r+   rn   zTestdir.getpathnode   s    ~~))$//r-   colitemsc                 8    | j                   j                  |      S )zSee :meth:`Pytester.genitems`.)r)   genitems)r*   ro   s     r+   rq   zTestdir.genitems   s    ~~&&x00r-   c                 8    | j                   j                  |      S )zSee :meth:`Pytester.runitem`.)r)   runitemrP   s     r+   rs   zTestdir.runitem   s    ~~%%f--r-   c                 <     | j                   j                  |g| S )z&See :meth:`Pytester.inline_runsource`.)r)   inline_runsource)r*   rQ   cmdlineargss      r+   ru   zTestdir.inline_runsource   s    .t~~..vDDDr-   c                 4     | 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~~114B6BBr-   c                 :     | j                   j                  |i |S )zSee :meth:`Pytester.runpytest`.)r)   	runpytestr[   s      r+   r   zTestdir.runpytest   s    't~~''888r-   c                 4     | j                   j                  | S )z!See :meth:`Pytester.parseconfig`.)r)   parseconfigry   s     r+   r   zTestdir.parseconfig   s    )t~~))400r-   c                 4     | j                   j                  | S )z$See :meth:`Pytester.parseconfigure`.)r)   parseconfigurery   s     r+   r   zTestdir.parseconfigure   s    ,t~~,,d33r-   c                 :    | j                   j                  ||      S )zSee :meth:`Pytester.getitem`.)r)   getitem)r*   rQ   funcnames      r+   r   zTestdir.getitem   s    ~~%%fh77r-   c                 8    | j                   j                  |      S )zSee :meth:`Pytester.getitems`.)r)   getitemsrP   s     r+   r   zTestdir.getitems   s    ~~&&v..r-   c                 >    | j                   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                 :    | j                   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                 B     | 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Ib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Ir-   c                 8    | j                   j                  |      S )zSee :meth:`Pytester.runpython`.)r)   	runpython)r*   scripts     r+   r   zTestdir.runpython   rV   r-   c                 8    | j                   j                  |      S )z!See :meth:`Pytester.runpython_c`.)r)   runpython_c)r*   commands     r+   r   zTestdir.runpython_c   s    ~~))'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~~22DJ'JJr-   stringexpect_timeoutzpexpect.spawnc                 <    | j                   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Qr-   cmdc                 <    | j                   j                  ||      S )zSee :meth:`Pytester.spawn`.r   )r)   spawn)r*   r   r   s      r+   r   zTestdir.spawn   s    ~~##C#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(   )	test_func)rz   F)g      $@)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/&55NG5@E " " "$ " 0 0 0 9k 9 9 ' ' & & ^^) ) +[ + +@< @&*
J 
J@k @; ;0 0 0E; EG[ GHk H27[ 79{ 9> >3f 3huT9_7M.N 301eD)O&<!= 1$t* 1.E5 )+U 
d 
Ci C9I 91F 14v 48/
<<'*<	%i(	)< 	J %) J	 J09 03 37 K9 K
 48RR+0R	RH He H H,# ,   r-   r    c                   0    e Zd Zeededefd              Zy)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0r-   N)r   r   r   staticmethodr   r   r    r   rz   r-   r+   r   r     s*    1( 1w 1  1r-   r   c                   X    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y)TempdirFactorya  Backward compatibility wrapper that implements ``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                (    t        |       || _        y r(   )r   r   )r*   r   r$   s      r+   r,   zTempdirFactory.__init__  s     	y! /r-   basenamenumberedc                 h    t        | j                  j                  ||      j                               S )zOSame as :meth:`TempPathFactory.mktemp`, but returns a ``py.path.local`` object.)r   r   mktempresolve)r*   r   r   s      r+   r   zTempdirFactory.mktemp$  s)    40077(KSSUVVr-   c                 d    t        | j                  j                         j                               S )zTSame as :meth:`TempPathFactory.getbasetemp`, but returns a ``py.path.local`` object.)r   r   getbasetempr   r0   s    r+   r   zTempdirFactory.getbasetemp(  s%    400<<>FFH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>B0	0Ws Wd Wk WJ[ Jr-   r   c                   b    e Zd Ze ed      dedefd              Zeedede	fd              Z
y)	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:`temporary directory location and retention`.

        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.tmpdir5  s    * 8$$r-   N)r   r   r   r   r   r   r   r   r   r   r1   rz   r-   r+   r   r   -  sY    9- -> -  -
 % %+ %  %r-   r   r*   rd   r&   c                 6    t        | j                  |            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   M  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   U      tyy!!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   Z       t~~&&r-   c                 R    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   d  s      s41155677r-   c                 >    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   o  s     s4==)**r-   c                 Z    | j                   rt        t        | j                               S 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   y  s#     .2\\;s4<<()Ct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(  rp| j                   J | j                   j                  }t        |t              rt	        j
                  |      n|}|D cg c]  }t        t        ||z               c}S t        d| |      c c}w )Npathlistzunknown configuration type: )r   parent
isinstancer   shlexsplitr   
ValueError)r*   rd   r   r   dpinput_valuesxs          r+   Config__getini_unknown_typer     s}     z||'''\\  -7s-Cu{{5)2>?QCQK(??7v>FF @s   Bc                 ,    t        | j                        S )z4(deprecated) returns a legacy_path copy of self.pathr   r0   s    r+   Node_fspathr     r   r-   c                 $    t        |      | _        y r(   )r   r/   )r*   r   s     r+   Node_fspath_setr    s    UDIr-   T)tryfirstearly_configc                    t               }| j                  |j                         |j                  t        dt
        d       |j                  t        dt        t              d       |j                  t        dt        t              d       |j                  t        dt        t              d       |j                  t        dt        t              d       |j                  t        dt        t              d       |j                  t        dt        t               d       |j                  t        d	t"               |j                  t$        dt        t&        t(              d       y
)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    s    
BRWW% JJuiJ> JJ~x2G)HRWJX JJ*h/H&ISX  
 JJv'2G)HRWJXJJvy(>":EJJJJvy(>":EJJ JJw
H_$=uJM JJv-/JK JJtXx_EuJUr-   ri   c                 B   | j                   j                  d      rut               }| j                  |j                         	 | j
                  }t        |d      }|j                  | d|d       | j                   j                  t        d       yy# t        $ r Y -w xY w)	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]277#	P%77
 ,,<MNJJv/JO%%&8:MN# 1  		s   B 	BBpluginmanagerc                     | |j                  d      u }|r-|j                  t              s|j                  t        d       y y y )Nr%   zlegacypath-pytester)
get_pluginis_registeredr   r  )r  r  is_pytesters      r+   pytest_plugin_registeredr!    sD     G..z::K7001DE,.CD F{r-   )Br   dataclassespathlibr   r   r   typingr   r   r   r   r   r	   	iniconfigr
   _pytest.cacheproviderr   _pytest.compatr   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   pexpectr    r   	dataclassr   r   r   r   r   r   r   r   r   r   r   r   r  r  r  objectr!  rz   r-   r+   <module>r4     s6   E            $ ' & & ! # . - $ +   + #   ) % & - *  T  T  T n
1 
1 J J  J8% %@) )S )[ )" "; "
'$4 ' '8 8; 8+ +K +D DH[$9 D'' 'k '
G
G
G',S$s)^'<
G"d "{ "
$ { t  
4V V4 V V> 
OV O O 
O, 
EV E6I Ed E 
Er-   