ó
    áÅŸgo,  ã                  óL  • S r SSKJr  SSKrSSKrSSKJr  SSKrSSKJ	r	  SSK
r
SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK J!r!  SSK J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(  SSK)J*r*  \*\\+\,4      " 5       r-\S   r.\\R^                   " S S5      5       5       r0S,S  jr1S-S! jr2S.S" jr3\!" S#S$9S/S% j5       r4S0S& jr5\!      S1S' j5       r6S2S( jr7\" S)S)S*9    S3S+ j5       r8g)4z>Support for providing temporary directories to test functions.é    )ÚannotationsN)ÚPath)Úrmtree)ÚAny)ÚDict)Úfinal)Ú	Generator)Ú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)ÚStashKey©ÚallÚfailedÚnonec                  óÂ   • \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'   S
\S'    SSS.           SS jjjr\SS.     SS jj5       rSS jr	SSS jjr
SS jrSrg)ÚTempPathFactoryé)   z‹Factory 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_policyNF©Ú	_ispytestc               óÌ   • [        U5        Uc  S U l        O6[        [        R                  R                  [        U5      5      5      U l        X@l        X l        X0l	        XPl
        g ©N)r   r%   r   ÚosÚpathÚabspathÚstrr&   r)   r+   r'   )ÚselfÚgiven_basetempÚretention_countÚretention_policyÚtraceÚbasetempr-   s          ÚO/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/_pytest/tmpdir.pyÚ__init__ÚTempPathFactory.__init__7   sQ   € ô 	�yÔ!ØÑ!Ø#'ˆDÕ ô
 $(¬¯©¯©¼¸NÓ8KÓ(LÓ#MˆDÔ ØŒØ /ÔØ!1ÔØ!�ó    c               ó0  • [        U5        [        UR                  S5      5      nUS:  a  [        SU S35      eUR                  S5      nUS;  a  [        SU S35      eU " UR                  R
                  UR                  R                  S5      UUS	S
9$ )zDCreate a factory according to pytest configuration.

:meta private:
Útmp_path_retention_countr   z6tmp_path_retention_count must be >= 0. Current input: Ú.Útmp_path_retention_policyr   zKtmp_path_retention_policy must be either all, failed, none. Current input: ÚtmpdirT)r5   r8   r6   r7   r-   )r   r(   ÚgetiniÚ
ValueErrorÚoptionr9   r8   Úget)ÚclsÚconfigr-   ÚcountÚpolicys        r:   Úfrom_configÚTempPathFactory.from_configN   s­   € ô 	�yÔ!Ü�F—M‘MÐ"<Ó=Ó>ˆØ�1‹9ÜØHÈÈÈqÐQóð ð —‘Ð:Ó;ˆØÐ2Ó2ÜØ]Ð^dÐ]eÐefÐgóð ñ Ø!Ÿ=™=×1Ñ1Ø—,‘,×"Ñ" 8Ó,Ø!Ø#Øñ
ð 	
r=   c                óÚ   • [         R                  R                  U5      nU R                  5       U-  R	                  5       R
                  U R                  5       :w  a  [        U S35      eU$ )Nz& is not a normalized and relative path)r0   r1   ÚnormpathÚgetbasetempÚresolveÚparentrD   )r4   Úbasenames     r:   Ú_ensure_relative_to_basetempÚ,TempPathFactory._ensure_relative_to_basetempn   s\   € Ü—7‘7×#Ñ# HÓ-ˆØ×ÑÓ Ñ)×2Ñ2Ó4×;Ñ;¸t×?OÑ?OÓ?QÓQÜ ˜zÐ)OÐPÓQÐQØˆr=   c                óì   • U R                  U5      nU(       d0  U R                  5       R                  U5      nUR                  SS9  U$ [	        U R                  5       USS9nU R                  SU5        U$ )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ÚprefixrX   Úmktemp)rS   rO   ÚjoinpathÚmkdirr   r&   )r4   rR   ÚnumberedÚps       r:   r[   ÚTempPathFactory.mktempt   sr   € ð ×4Ñ4°XÓ>ˆÞØ× Ñ Ó"×+Ñ+¨HÓ5ˆAØ�G‰G˜ˆGÑð ˆô " t×'7Ñ'7Ó'9À(ÐQVÑWˆAØ�K‰K˜ !Ô$Øˆr=   c                óì  • U R                   b  U R                   $ U R                  bM  U R                  nUR                  5       (       a  [        U5        UR	                  SS9  UR                  5       nGO-[        R                  R                  S5      n[        U=(       d    [        R                  " 5       5      R                  5       n[        5       =(       d    SnUR                  SU 35      n UR	                  SSS9  [        5       nUbe  UR!                  5       nUR"                  U:w  a  [        S	U S
35      eUR$                  S-  S:w  a#  [        R&                  " XWR$                  S-  5        U R(                  nU R*                  S:X  a  Sn[-        SUU[.        SS9nUc   U5       eXl         U R1                  SU5        U$ ! [         a$    UR                  S5      nUR	                  SSS9   Nòf = f)ziReturn the base temporary directory, creating it if needed.

:returns:
    The base temporary directory.
rV   rW   ÚPYTEST_DEBUG_TEMPROOTÚunknownz
pytest-of-T)rX   Úexist_okzpytest-of-unknownzThe temporary directory z: is not owned by the current user. Fix this and try again.é?   r   iÀÿÿÿr    zpytest-)rZ   rY   ÚkeepÚlock_timeoutrX   znew basetemp)r'   r%   Úexistsr   r]   rP   r0   ÚenvironrF   r   ÚtempfileÚ
gettempdirÚget_userr\   ÚOSErrorr   ÚstatÚst_uidÚst_modeÚchmodr)   r+   r   r   r&   )	r4   r9   Úfrom_envÚtemprootÚuserÚrootdirÚuidÚrootdir_statrf   s	            r:   rO   ÚTempPathFactory.getbasetempŒ   sÓ  € ð �>‰>Ñ%Ø—>‘>Ð!à×ÑÑ+Ø×+Ñ+ˆHØ�‰× Ñ Ü�h”Ø�N‰N ˆNÑ&Ø×'Ñ'Ó)ŠHä—z‘z—~‘~Ð&=Ó>ˆHÜ˜H×=¬×(;Ò(;Ó(=Ó>×FÑFÓHˆHÜ“:×* ˆDð ×'Ñ'¨*°T°FÐ(;Ó<ˆGð9Ø—‘ 5°4�Ñ8ô “-ˆCØ‰Ø&Ÿ|™|›~�Ø×&Ñ&¨#Ó-Ü!Ø2°7°)ð <2ð 2óð ð !×(Ñ(¨5Ñ0°QÓ6Ü—H’H˜W×&:Ñ&:¸VÑ&CÔDØ×(Ñ(ˆDØ×%Ñ%¨Ó/Ø�Ü5Ø ØØÜ)ØñˆHð Ñ#Ð- XÓ-Ð#Ø!ŒØ�‰�N HÔ-ØˆøôC ó 9à"×+Ñ+Ð,?Ó@�Ø—‘ 5°4�Ó8ð9ús   Ã0G Ç+G3Ç2G3)r'   r%   r)   r+   r&   r/   )r5   r$   r6   r(   r7   r*   r9   r$   r-   ÚboolÚreturnÚNone)rH   r   r-   ry   rz   r"   )rR   r3   rz   r3   )T)rR   r3   r^   ry   rz   r   )rz   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r;   ÚclassmethodrK   rS   r[   rO   Ú__static_attributes__© r=   r:   r"   r"   )   s¸   ‡ ñð !Ó àƒKØÓØÓØ$Ó$ð !%ð"ð  ñ"à#ð"ð ð"ð (ð	"ð ð"ð ð"ð 
ö"ð. ð
  ñ	
àð
ð ð	
ð
 
ô
ó ð
ô>ö÷09r=   r"   c                 ób   •  SSK n U R                  5       $ ! [        [        [        4 a     gf = f)zhReturn the current user name, or None if getuser() does not work
in the current environment (see #1010).r   N)ÚgetpassÚgetuserÚImportErrorrm   ÚKeyError)r†   s    r:   rl   rl   È   s0   € ðãà�‰Ó Ð øÜœ¤(Ð+ó Ùðús   ‚ –.­.c                óš   • [        5       nU R                  UR                  5        [        R	                  U SS9nUR                  U SUSS9  g)z÷Create 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.
Tr,   Ú_tmp_path_factoryF)ÚraisingN)r   Úadd_cleanupÚundor"   rK   Úsetattr)rH   Úmpr‹   s      r:   Úpytest_configurer‘   Ô   sI   € ô 
‹€BØ
×Ñ�r—w‘wÔÜ'×3Ñ3°FÀdÐ3ÐKÐØ‡J�JˆvÐ*Ð,=Àu€JÒMr=   c                óH   • U R                  SSSS9  U R                  SSSS9  g )Nr?   zfHow many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`.é   )ÚhelpÚdefaultrA   zvControls which directories created by the `tmp_path` fixture are kept around, based on test outcome. (all/failed/none)r   )Úaddini)Úparsers    r:   Úpytest_addoptionr˜   á   s:   € Ø
‡M�MØ"ØuØð ñ ð ‡M�MØ#ðàð	 ò r=   Úsession)Úscopec                ó.   • U R                   R                  $ )zGReturn a :class:`pytest.TempPathFactory` instance for the test session.)rH   r‹   )Úrequests    r:   Útmp_path_factoryr�   ð   s   € ð �>‰>×+Ñ+Ð+r=   c                óŒ   • U R                   R                  n[        R                  " SSU5      nSnUS U nUR	                  USS9$ )Nz[\W]Ú_é   T)r^   )ÚnodeÚnameÚreÚsubr[   )rœ   Úfactoryr¢   ÚMAXVALs       r:   Ú_mk_tmpr§   ÷   sF   € Ø�<‰<×Ñ€DÜ�6Š6�'˜3 Ó%€DØ€FØ��ˆ=€DØ�>‰>˜$¨ˆ>Ð.Ð.r=   c              #  ó@  #   • [        X5      nUv •  U R                  R                  R                  nUR                  nU R
                  R                  [           nUS:X  a!  UR                  SS5      (       a
  [        USS9  U R
                  R                  [        	 g7f)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`.
r   ÚcallT©Úignore_errorsN)
r§   r™   rH   r‹   r+   r¡   ÚstashÚtmppath_result_keyrF   r   )rœ   r�   r1   rJ   Úresult_dicts        r:   Útmp_pathr¯   ÿ   s…   é € ô �7Ó-€DØ
‚Jð )0¯©×(>Ñ(>×(PÑ(PÐØ×/Ñ/€FØ—,‘,×$Ñ$Ô%7Ñ8€Kà�Ó˜kŸo™o¨f°d×;Ñ;ô 	ˆt 4Ò(à�‰×ÑÔ-Ñ.ùs   ‚BBc                ó  • U R                   R                  nUR                  nUc  gUR                  nUS:X  a2  US:X  a,  UR                  c  UR                  5       (       a
  [        USS9  UR                  5       (       a  [        U5        gg)zˆAfter each session, remove base directory if all the tests passed,
the policy is "failed", and the basetemp is not specified by a user.
Nr   r   Trª   )rH   r‹   r'   r+   r%   Úis_dirr   r   )r™   Ú
exitstatusr�   r9   rJ   s        r:   Úpytest_sessionfinishr³     sƒ   € ð )0¯©×(HÑ(HÐØ×)Ñ)€HØÑØà×/Ñ/€Fà�a‹Ø�hÓØ×,Ñ,Ñ4à�?‰?×Ñô �8¨4Ò0ð ‡�×ÑÜ˜hÕ'ð r=   T)ÚwrapperÚtryfirstc              #  ó¦   #   • S v •nUR                   c   e0 nUR                  U R                  R                  [        U5      UR                   '   U$ 7fr/   )ÚwhenÚpassedr¬   Ú
setdefaultr­   )Úitemr©   ÚrepÚemptys       r:   Úpytest_runtest_makereportr½   2  sJ   é € ò €CØ�8‰8ÑÐÐØ€EØADÇÁ€D‡J�J×ÑÔ,¨eÓ4°S·X±XÑ>Ø€Jùs   ‚AA)rz   z
str | None)rH   r   rz   r{   )r—   r   rz   r{   )rœ   r   rz   r"   )rœ   r   r¥   r"   rz   r   )rœ   r   r�   r"   rz   zGenerator[Path])r²   zint | ExitCode)rº   r   rz   z'Generator[None, TestReport, TestReport])9r€   Ú
__future__r   Údataclassesr0   Úpathlibr   r£   Úshutilr   rj   Útypingr   r   r   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   r3   ry   r­   r*   Ú	dataclassr"   rl   r‘   r˜   r�   r§   r¯   r³   r½   r„   r=   r:   Ú<module>rÍ      s7  ðá Då "ã Û 	Ý Û 	Ý Û Ý Ý Ý Ý Ý å *Ý !Ý &Ý 3Ý Ý &Ý !Ý #Ý #Ý ,Ý -Ý $Ý +Ý +Ý Ý &Ý "ð ˜d 3¨ 9™oÒ.Ó0Ð ØÐ/Ñ0€ð Ø×Ñ÷Zð Zó ó ðZôz	ô
Nôñ 	ˆyÑó,ó ð,ô/ð 	ð/Øð/Ø/>ð/àó/ó 	ð/ô2(ñ2 
�$ Ñ&ðØ
ðà,óó 'ñr=   