403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/_pytest/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/_pytest/__pycache__/tmpdir.cpython-312.pyc
�

��Hg�-��H�dZddlmZddlZddlZddlmZddlZddlm	Z	ddl
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*e*e
e+e,f�Z-edZ.eej^Gd�d���Z0d,d �Z1d-d!�Z2d.d"�Z3e!d#�$�d/d%��Z4d0d&�Z5e!						d1d'��Z6d2d(�Z7ed)d)�*�				d3d+��Z8y)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��eZdZUdZded<ded<ded<ded<d	ed
<	ddd
�											dd�Zedd
�					dd��Zdd�Zddd�Z	dd�Z
y)�TempPathFactoryz�Factory for temporary directories under the common base temp directory.

    The base directory can be configured using the ``--basetemp`` option.
    �Path | None�_given_basetempr�_trace�	_basetemp�int�_retention_count�
RetentionType�_retention_policyNF��	_ispytestc���t|�|�d|_n6ttjjt
|���|_||_||_||_	||_
y�N)rr$r�os�path�abspath�strr%r(r*r&)�self�given_basetemp�retention_count�retention_policy�trace�basetempr,s       �0C:\Python312\Lib\site-packages\_pytest/tmpdir.py�__init__zTempPathFactory.__init__8sY��	�y�!��!�#'�D� �
$(�������N�8K�(L�#M�D� ���� /���!1���!���c�0�t|�t|jd��}|dkrtd|�d���|jd�}|dvrtd|�d���||jj
|jjd�||d	�
�S)zTCreate a factory according to pytest configuration.

        :meta private:
        �tmp_path_retention_countrz6tmp_path_retention_count must be >= 0. Current input: �.�tmp_path_retention_policyrzKtmp_path_retention_policy must be either all, failed, none. Current input: �tmpdirT)r4r7r5r6r,)rr'�getini�
ValueError�optionr8r7�get)�cls�configr,�count�policys     r9�from_configzTempPathFactory.from_configOs���	�y�!��F�M�M�"<�=�>���1�9��H���q�Q��
����:�;���2�2��]�^d�]e�ef�g��
��!�=�=�1�1��,�,�"�"�8�,�!�#��
�	
r;c���tjj|�}|j�|zj	�j
|j�k7rt
|�d���|S)Nz& is not a normalized and relative path)r/r0�normpath�getbasetemp�resolve�parentrB)r3�basenames  r9�_ensure_relative_to_basetempz,TempPathFactory._ensure_relative_to_basetempos\���7�7�#�#�H�-�������)�2�2�4�;�;�t�?O�?O�?Q�Q���z�)O�P�Q�Q��r;c���|j|�}|s3|j�j|�}|jd��|St	|j�|d��}|jd|�|S)aCreate 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�prefixrT�mktemp)rPrL�joinpath�mkdirrr%)r3rO�numbered�ps    r9rWzTempPathFactory.mktempusr���4�4�X�>���� � �"�+�+�H�5�A�
�G�G��G����"�t�'7�'7�'9�(�QV�W�A��K�K��!�$��r;c���|j�|jS|j�K|j}|j�rt|�|j	d��|j�}�n$tjjd�}t|xstj��j�}t�xsd}|jd|���}	|j	dd��t�}|�c|j!�}|j"|k7rtd	|�d
���|j$dzdk7r#t
j&||j$d
z�|j(}|j*dk(rd}t-d||t.d��}|�J|��||_|j1d|�|S#t$r'|jd�}|j	dd��Y��wxYw)z�Return the base temporary directory, creating it if needed.

        :returns:
            The base temporary directory.
        rRrS�PYTEST_DEBUG_TEMPROOT�unknownz
pytest-of-T)rT�exist_okzpytest-of-unknownzThe temporary directory z: is not owned by the current user. Fix this and try again.�?ri����r zpytest-)rVrU�keep�lock_timeoutrTznew basetemp)r&r$�existsrrYrMr/�environrDr�tempfile�
gettempdir�get_userrX�OSErrorr�stat�st_uid�st_mode�chmodr(r*rr
r%)	r3r8�from_env�temproot�user�rootdir�uid�rootdir_statras	         r9rLzTempPathFactory.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�l�&:�&:�V�&C�D��(�(�D��%�%��/���5� ���)���H��#�-�X�-�#�!������N�H�-����C�
9�"�+�+�,?�@���
�
�5�4�
�8�
9�s�!F8�8-G(�'G(r.)r4r#r5r'r6r)r8r#r,�bool�return�None)rFrr,rsrtr")rOr2rtr2)T)rOr2rZrsrtr)rtr)�__name__�
__module__�__qualname__�__doc__�__annotations__r:�classmethodrIrPrWrL�r;r9r"r")s����
!� ��K�����$�$�!%�
"� �"�#�"��"�(�	"��
"��"�
�"�.�
 �	
��
��	
�

�
��
�>��09r;r"c�`�	ddl}|j�S#tttf$rYywxYw)zlReturn the current user name, or None if getuser() does not work
    in the current environment (see #1010).rN)�getpass�getuser�ImportErrorrh�KeyError)r~s r9rgrg�s0������� � ����(�+����s��-�-c��t�}|j|j�tj	|d��}|j|d|d��y)aCreate 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"rI�setattr)rF�mpr�s   r9�pytest_configurer��sI��
��B�
���r�w�w��'�3�3�F�d�3�K���J�J�v�*�,=�u�J�Mr;c�T�|jddd��|jddd��y)Nr=zfHow many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`.�)�help�defaultr?zvControls which directories created by the `tmp_path` fixture are kept around, based on test outcome. (all/failed/none)r)�addini)�parsers r9�pytest_addoptionr��s:��
�M�M�"�
u�����M�M�#���	�r;�session)�scopec�.�|jjS)zGReturn a :class:`pytest.TempPathFactory` instance for the test session.)rFr�)�requests r9�tmp_path_factoryr��s���>�>�+�+�+r;c��|jj}tjdd|�}d}|d|}|j	|d��S)Nz[\W]�_�T)rZ)�node�name�re�subrW)r��factoryr��MAXVALs    r9�_mk_tmpr��sF���<�<���D�
�6�6�'�3��%�D�
�F����=�D��>�>�$��>�.�.r;c#�<K�t||�}|��|jjj}|j}|j
jt}|dk(r|jdd�r
t|d��|j
jt=y�w)agReturn 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.
    This behavior can be configured with :confval:`tmp_path_retention_count` and
    :confval:`tmp_path_retention_policy`.
    If ``--basetemp`` is used then it is cleared each session. See
    :ref:`temporary directory location and retention`.

    The returned object is a :class:`pathlib.Path` object.
    r�callT��
ignore_errorsN)
r�r�rFr�r*r��stash�tmppath_result_keyrDr)r�r�r0rH�result_dicts     r9�tmp_pathr�s�����"�7�,�-�D�
�J�)0���(>�(>�(P�(P��
�
/�
/�F��,�,�$�$�%7�8�K�
���k�o�o�f�d�;�	�t�4�(������-�.�s�BBc��|jj}|j}|�y|j}|dk(r.|dk(r)|j�|j�r
t
|d��|j�rt|�yy)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.
    NrrTr�)rFr�r&r*r$�is_dirrr)r��
exitstatusr�r8rHs     r9�pytest_sessionfinishr�!s}��)0���(H�(H���)�)�H����
�
/�
/�F��a���h���,�,�4��?�?��
�8�4�0������h�'�r;T)�wrapper�tryfirstc#�K�d��}|j�J�i}|j|jjt|�|j<|S�wr.)�when�passedr��
setdefaultr�)�itemr��rep�emptys    r9�pytest_runtest_makereportr�:sK�����C��8�8�����E�AD���D�J�J���,�e�4�S�X�X�>��J�s�AA)rtz
str | None)rFrrtru)r�rrtru)r�rrtr")r�rr�r"rtr)r�rr�r"rtzGenerator[Path])r�zint | ExitCode)r�rrtz'Generator[None, TestReport, TestReport])9ry�
__future__r�dataclassesr/�pathlibrr��shutilrre�typingrrrr	r
rr
rrr�_pytest.compatr�_pytest.configrrr�_pytest.config.argparsingr�_pytest.deprecatedr�_pytest.fixturesrr�_pytest.monkeypatchr�
_pytest.nodesr�_pytest.reportsr�
_pytest.stashrr2rsr�r)�	dataclassr"rgr�r�r�r�r�r�r�r|r;r9�<module>r�s:��D�"��	��	��������*�!�&�3��&�!�#�#�,�-�$�+�+��&�"�/�X�d�3��9�o�.�0���/�0�
�����[�[���[�|	�
N��	�y��,��,�/�	�/�
�/�/>�/��/�	�/�@(�2
�$��&��
��,��'�r;

Youez - 2016 - github.com/yon3zu
LinuXploit