+
    Spj3                    ~   R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIt^ RI	t	^ RI
Ht ^ RIt^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^ R	IHt ^R
I
Ht ^RI
Ht ^RI
Ht ^RI
Ht ^RI
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI H!t! ^ RI"H#t# ^ RI$H%t% ^ RI$H&t& ^ RI'H(t( ^ RI)H*t* ^ RI+H,t, ^ RI-H.t. ].]/]0]13,          ,          ! 4       t2]R1,          t3]]Ph                   ! R R4      4       4       t5R R lt6R R  lt7R! R" lt8]%! R#R$7      R% R& l4       t9R' R( lt:]%R) R* l4       t;R+ R, lt<]! R-R-R.7      R/ R0 l4       t=R# )2z>Support for providing temporary directories to test functions.)annotationsN)	Generator)	ExitStack)Path)rmtree)Any)final)Literal)cleanup_dead_symlinks)LOCK_TIMEOUT)make_numbered_dir)make_numbered_dir_with_cleanup)rm_rf)get_user_id)Config)ExitCode)hookimpl)Parser)check_ispytest)fixture)FixtureRequest)MonkeyPatch)Item)
TestReport)StashKeyc                      ] tR t^+t$ RtR]R&   R]R&   R]R&   R]R&   R	]R
&   RRR/R R lllt]RR/R R ll4       tR R lt	RR R llt
R R ltRtR# )TempPathFactoryzFactory for temporary directories under the common base temp directory,
as discussed at :ref:`temporary directory location and retention`.
Path | None_given_basetempr   _trace	_basetempint_retention_countRetentionType_retention_policyN	_ispytestFc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )   given_basetempr   retention_countr!   retention_policyr#   basetempr%   boolreturnNone )formats   "5/tmp/pip-target-d46v3snk/lib/python/_pytest/tmpdir.py__annotate__TempPathFactory.__annotate__9   sF     ' '#' ' (	' ' ' 
'    c               	    \        V4       Vf	   R V n        M6\        \        P                  P                  \        V4      4      4      V n        W@n        W n        W0n	        WPn
        \        4       V n        R # N)r   r   r   ospathabspathstrr   r"   r$   r    r   _exit_stack)selfr(   r)   r*   tracer+   r%   s   &&&&&&$r1   __init__TempPathFactory.__init__9   s]     	y!!#'D 
 $(N8K(L#MD  /!1! %;r4   c               $    V ^8  d   QhRRRRRR/# )r'   configr   r%   r,   r-   r   r/   )r0   s   "r1   r2   r3   T   s(     
 

 	

 

r4   c               :   \        V4       \        VP                  R4      4      pV^ 8  d   \        RV R24      hVP                  R4      pVR	9  d   \        RV R24      hV ! VP                  P
                  VP                  P                  R4      VVRR7      # )
zDCreate a factory according to pytest configuration.

:meta private:
tmp_path_retention_countz6tmp_path_retention_count must be >= 0. Current input: .tmp_path_retention_policyzKtmp_path_retention_policy must be either all, failed, none. Current input: tmpdirT)r(   r=   r)   r*   r%   allfailednone)r   r!   getini
ValueErroroptionr+   r=   get)clsrA   r%   countpolicys   &&$  r1   from_configTempPathFactory.from_configS   s     	y!FMM"<=>19HqQ  :;22]^d]eefg  !==11,,""8,!#
 	
r4   c                    V ^8  d   QhRRRR/# )r'   basenamer:   r-   r/   )r0   s   "r1   r2   r3   s   s      S S r4   c                	    \         P                  P                  V4      pV P                  4       V,          P	                  4       P
                  V P                  4       8w  d   \        V R 24      hV# )z& is not a normalized and relative path)r7   r8   normpathgetbasetempresolveparentrL   )r<   rU   s   &&r1   _ensure_relative_to_basetemp,TempPathFactory._ensure_relative_to_basetemps   s\    77##H-)224;;t?O?O?QQz)OPQQr4   c               $    V ^8  d   QhRRRRRR/# )r'   rU   r:   numberedr,   r-   r   r/   )r0   s   "r1   r2   r3   y   s!      s d d r4   c                    V P                  V4      pV'       g4   V P                  4       P                  V4      pVP                  RR7       V# \	        V P                  4       VRR7      pV P                  RV4       V# )a  Create a new temporary directory managed by the factory.

:param basename:
    Directory base name, must be a relative path.

:param numbered:
    If ``True``, ensure the directory is unique by adding a numbered
    suffix greater than any existing one: ``basename="foo-"`` and ``numbered=True``
    means that this function will create directories named ``"foo-0"``,
    ``"foo-1"``, ``"foo-2"`` and so on.

:returns:
    The path to the new directory.
  mode)rootprefixrb   mktemp)r[   rX   joinpathmkdirr   r   )r<   rU   r^   ps   &&& r1   re   TempPathFactory.mktempy   sr     44X>  "++H5AGGG  "t'7'7'9(QVWAKK!$r4   c                   V ^8  d   QhRR/# )r'   r-   r   r/   )r0   s   "r1   r2   r3      s     T TT Tr4   c           	     *   V P                   e   V P                   # V P                  eR   V P                  pVP                  4       '       d   \        V4       VP	                  RR7       VP                  4       pEM@\        P                  P                  R4      p\        T;'       g    \        P                  ! 4       4      P                  4       p\        4       ;'       g    RpVP                  RV 24      p VP	                  RRR7       \        4       pVe   \        P                   \        P"                  9   d   R	MRpVP!                  VR
7      p\         P$                  ! VP&                  4      '       d   \        RV R24      hVP(                  V8w  d   \        RV R24      hVP&                  ^?,          ^ 8w  dL   \        P*                  \        P"                  9   d   R	MRp	VP+                  VP&                  R,          V	R
7       V P,                  p
V P.                  R8X  d   ^ p
\1        RVV
\2        RV P4                  P6                  R7      p\8        P:                  ! V P4                  P<                  4       V P4                  P7                  \8        P>                  V P4                  P<                  4       Vf   Q V4       hWn         V PA                  RV4       V#   \         d)    TP                  R4      pTP	                  RRR7        ELi ; i)ziReturn the base temporary directory, creating it if needed.

:returns:
    The base temporary directory.
r`   ra   PYTEST_DEBUG_TEMPROOTunknownz
pytest-of-T)rb   exist_okzpytest-of-unknownF)follow_symlinkszThe temporary directory z, is a symbolic link. Fix this and try again.z: is not owned by the current user. Fix this and try again.rJ   zpytest-)rd   rc   keeplock_timeoutrb   registerznew basetempi)!r    r   existsr   rg   rY   r7   environrN   r   tempfile
gettempdirget_userrf   OSErrorr   statsupports_follow_symlinksS_ISLNKst_modest_uidchmodr"   r$   r   r   r;   callbackatexitrr   close
unregisterr   )r<   r+   from_envtemprootuserrootdiruidstat_follow_symlinksrootdir_statchmod_follow_symlinksrp   s   &          r1   rX   TempPathFactory.getbasetemp   s    >>%>>!+++H  hNNN&'')Hzz~~&=>HH==(;(;(=>FFHH:**D ''*TF(;<G9548$ -CWW(C(CCE %  '||<P|Q<< 4 455!27) <2 2   &&#-!27) <2 2  !((50Q6!#R-H-H!Hd * MM$,,v5(= "  ((D%%/5 )))22H OOD,,223%%f&7&79I9I9O9OP#-X-#!NH-y  9"++,?@5489s   8K /LL)r    r;   r   r"   r$   r   r6   )T)__name__
__module____qualname____firstlineno____doc____annotations__r>   classmethodrR   r[   re   rX   __static_attributes__r/   r4   r1   r   r   +   sn     ! K$$'  ' '4 
  	
 
>0T Tr4   r   c                   V ^8  d   QhRR/# )r'   r-   z
str | Noner/   )r0   s   "r1   r2   r2      s     	 	* 	r4   c                 f     ^ RI p V P                  4       #   \        \        \        3 d     R# i ; i)zhReturn the current user name, or None if getuser() does not work
in the current environment (see #1010).N)getpassgetuserImportErrorrx   KeyError)r   s    r1   rw   rw      s0      (+ s    00c                    V ^8  d   QhRRRR/# )r'   rA   r   r-   r.   r/   )r0   s   "r1   r2   r2      s     
N 
NV 
N 
Nr4   c                    \        4       pV P                  VP                  4       \        P	                  V RR7      pVP                  V RVRR7       R# )zCreate a TempPathFactory and attach it to the config object.

This is to comply with existing plugins which expect the handler to be
available at pytest_configure time, but ideally should be moved entirely
to the tmp_path_factory session fixture.
T)r%   _tmp_path_factoryF)raisingN)r   add_cleanupundor   rR   setattr)rA   mpr   s   &  r1   pytest_configurer      sI     
B
rww'33Fd3KJJv*,=uJMr4   c                    V ^8  d   QhRRRR/# )r'   parserr   r-   r.   r/   )r0   s   "r1   r2   r2     s      V  r4   c                Z    V P                  R RRRR7       V P                  RRRRR7       R	# )
rC   zfHow many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`.3string)helpdefaulttyperE   zvControls which directories created by the `tmp_path` fixture are kept around, based on test outcome. (all/failed/none)rH   )r   r   r   N)addini)r   s   &r1   pytest_addoptionr     s@    
MM"u   MM#  r4   session)scopec                    V ^8  d   QhRRRR/# )r'   requestr   r-   r   r/   )r0   s   "r1   r2   r2     s     , ,n , ,r4   c                .    V P                   P                  # )zGReturn a :class:`pytest.TempPathFactory` instance for the test session.)rA   r   )r   s   &r1   tmp_path_factoryr     s     >>+++r4   c               $    V ^8  d   QhRRRRRR/# )r'   r   r   factoryr   r-   r   r/   )r0   s   "r1   r2   r2     s!     / /^ /o /$ /r4   c                    V P                   P                  p\        P                  ! R RV4      p^pVRV pVP	                  VRR7      # )z[\W]_NT)r^   )nodenameresubre   )r   r   r   MAXVALs   &&  r1   _mk_tmpr     sF    <<D66'3%DF=D>>$>..r4   c               $    V ^8  d   QhRRRRRR/# )r'   r   r   r   r   r-   zGenerator[Path]r/   )r0   s   "r1   r2   r2   #  s$     / ///>//r4   c              #    "   \        W4      pVx  VP                  pV P                  P                  \        ,          pVR8X  d&   VP                  RR4      '       d   \        VRR7       V P                  P                  \         R# 5i)a'  Return a temporary directory (as :class:`pathlib.Path` object)
which is unique to each test function invocation.
The temporary directory is created as a subdirectory
of the base temporary directory, with configurable retention,
as discussed in :ref:`temporary directory location and retention`.
rI   callTignore_errorsN)r   r$   r   stashtmppath_result_keyrN   r   )r   r   r8   rQ   result_dicts   &&   r1   tmp_pathr   "  so      7-D
J //F,,$$%78Kkoofd;; 	t4(-.s   AB*Bc                   V ^8  d   QhRR/# )r'   
exitstatuszint | ExitCoder/   )r0   s   "r1   r2   r2   ;  s     ) )n )r4   c                b   V P                   P                  pVP                  pVf   R# VP                  pV^ 8X  d9   VR8X  d2   VP                  f$   VP                  4       '       d   \        VRR7       VP                  4       '       d   \        V4       VP                  P                  4        R# )zAfter each session, remove base directory if all the tests passed,
the policy is "failed", and the basetemp is not specified by a user.
NrI   Tr   )
rA   r   r    r$   r   is_dirr   r
   r;   r   )r   r   r   r+   rQ   s   &&   r1   pytest_sessionfinishr   ;  s     )0(H(H))H//Fah,,4?? 840 h'   &&(r4   T)wrappertryfirstc                    V ^8  d   QhRRRR/# )r'   itemr   r-   z'Generator[None, TestReport, TestReport]r/   )r0   s   "r1   r2   r2   X  s      
,r4   c              #     "   R x pVP                   f   Q h/ pVP                  V P                  P                  \        V4      VP                   &   V# 5ir6   )whenpassedr   
setdefaultr   )r   r   repemptys   &&  r1   pytest_runtest_makereportr   W  sJ      C88EADDJJ,e4SXX>Js   AArG   )>r   
__future__r   r   collections.abcr   
contextlibr   dataclassesr7   pathlibr   r   shutilr   ry   ru   typingr   r   r	   r
   r   r   r   r   _pytest.compatr   _pytest.configr   r   r   _pytest.config.argparsingr   _pytest.deprecatedr   _pytest.fixturesr   r   _pytest.monkeypatchr   _pytest.nodesr   _pytest.reportsr   _pytest.stashr   dictr:   r,   r   r#   	dataclassr   rw   r   r   r   r   r   r   r   r/   r4   r1   <module>r      s   D "  %    	  	       * ! & 3  & ! # # , - $ + +  & " d39o.0 /0 x x  xv	
N$ 	y, ,/ 	/ 	/0)8 
$& 'r4   