403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/_pytest/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/_pytest/__pycache__/tmpdir.cpython-39.pyc
a

05d.�@sHdZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddl	mZddl	mZddl	m
Z
dd	l	mZdd
l	mZddlmZddlmZdd
lmZer�ddlmZedZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!m"Z"ddl#m$Z$ddl#m%Z%ddl#m&Z&ddl'm(Z(ddl)m*Z*ddl)m+Z+ddl,m-Z-eee.e/f�Z0e!ej1Gdd �d ���Z2e
e.d!�d"d#�Z3e$dd$�d%d&�Z4edd'�d(d)�Z5e*d*d+�e+e2d,�d-d.��Z6e+e2ed/�d0d1�Z7e*e+e2eeddfd2�d3d4��Z8ee9e%fd5�d6d7�Z:e&d8d8d9�ed:�d;d<��Z;dS)=z>Support for providing temporary directories to test functions.�N)�Path)�rmtree)�Any)�Dict)�	Generator)�Optional)�
TYPE_CHECKING)�Union)�Item)�
CollectReport)�StashKey)�Literal��all�failed�none)�Parser�)�LOCK_TIMEOUT)�make_numbered_dir)�make_numbered_dir_with_cleanup)�rm_rf)�cleanup_dead_symlink)�final�get_user_id)�Config)�ExitCode)�hookimpl)�check_ispytest)�fixture)�FixtureRequest)�MonkeyPatchc	@s�eZdZUdZeeed<eed<eeed<eed<ded<dd	d
�eeedeee	dd�dd
�Z
ed	d
�ee	dd�dd��Z
eed�dd�Zdee	ed�dd�Zed�dd�ZdS)�TempPathFactoryz�Factory for temporary directories under the common base temp directory.

    The base directory can be configured using the ``--basetemp`` option.
    �_given_basetemp�_trace�	_basetemp�_retention_count�
RetentionType�_retention_policyNF��	_ispytest)�given_basetemp�retention_count�retention_policy�basetempr*�returncCsJt|�|durd|_nttj�t|���|_||_||_||_	||_
dS�N)rr#r�os�path�abspath�strr$r&r(r%)�selfr+r,r-�tracer.r*�r7�2/usr/lib/python3.9/site-packages/_pytest/tmpdir.py�__init__;s
zTempPathFactory.__init__)�configr*r/cCsnt|�t|�d��}|dkr.td|�d���|�d�}|dvrPtd|�d���||jj|j�d�||d	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_policyrzLtmp_path_retention_policy must be either all, failed, none. Current intput: ZtmpdirT)r+r6r,r-r*)r�intZgetini�
ValueError�optionr.r6�get)�clsr:r*�count�policyr7r7r8�from_configRs$
�

�
�zTempPathFactory.from_config)�basenamer/cCs8tj�|�}|��|��j|��kr4t|�d���|S)Nz& is not a normalized and relative path)r1r2�normpath�getbasetemp�resolve�parentr?)r5rFr7r7r8�_ensure_relative_to_basetemprsz,TempPathFactory._ensure_relative_to_basetempT)rF�numberedr/cCsL|�|�}|s*|���|�}|jdd�nt|��|dd�}|�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�prefixrO�mktemp)rKrH�joinpath�mkdirrr$)r5rFrL�pr7r7r8rRxs
zTempPathFactory.mktemp�r/c	Csb|jdur|jS|jdurF|j}|��r0t|�|jdd�|��}n�tj�d�}t	|p^t
�����}t�pnd}|�
d|���}z|jddd�Wn*ty�|�
d	�}|jddd�Yn0t�}|du�r|��}|j|kr�td
|�d���|jd@d
k�rt�||jd@�|j}|jdk�r(d
}td||tdd�}|du�sLJ|��||_|�d|�|S)z�Return the base temporary directory, creating it if needed.

        :returns:
            The base temporary directory.
        NrMrNZPYTEST_DEBUG_TEMPROOT�unknownz
pytest-of-T)rO�exist_okzpytest-of-unknownzThe temporary directory z: is not owned by the current user. Fix this and try again.�?ri����rzpytest-)rQrP�keepZlock_timeoutrOznew basetemp)r%r#�existsrrTrIr1�environrAr�tempfileZ
gettempdir�get_userrS�OSErrorr�stat�st_uid�st_mode�chmodr&r(rrr$)	r5r.Zfrom_envZtemproot�userZrootdir�uidZrootdir_statrZr7r7r8rH�sP







��zTempPathFactory.getbasetemp)N)T)�__name__�
__module__�__qualname__�__doc__rr�__annotations__rr>�boolr9�classmethodrrEr4rKrRrHr7r7r7r8r",s6
�����r"rVc	Cs0zddl}|��WSttfy*YdS0dS)zlReturn the current user name, or None if getuser() does not work
    in the current environment (see #1010).rN)�getpassZgetuser�ImportError�KeyError)rmr7r7r8r^�s

r^)r:r/cCs6t�}|�|j�tj|dd�}|j|d|dd�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)ZraisingN)r!Zadd_cleanupZundor"rE�setattr)r:Zmprpr7r7r8�pytest_configure�srr)�parserr/cCs$|jdddd�|jdddd�dS)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)Zaddini)rsr7r7r8�pytest_addoption�s��rw�session)Zscope)�requestr/cCs|jjS)zGReturn a :class:`pytest.TempPathFactory` instance for the test session.)r:rp)ryr7r7r8�tmp_path_factory�srz)ry�factoryr/cCs4|jj}t�dd|�}d}|d|�}|j|dd�S)Nz[\W]�_�T)rL)�node�name�re�subrR)ryr{rZMAXVALr7r7r8�_mk_tmp�s
r�)ryrzr/ccstt||�}|V|jjj}|j}|jjt}|dkrL|�dd�rLt	|dd�|jjt=|j
}|durhdSt|�dS)aUReturn 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:`base
    temporary directory`.

    The returned object is a :class:`pathlib.Path` object.
    r�callT��
ignore_errorsN)r�rxr:rpr(r~�stash�tmppath_result_keyrArr%r)ryrzr2rDZresult_dictr.r7r7r8�tmp_paths


r�)�
exitstatuscCsT|jj}|jdurdS|j}|dkrP|dkrP|jdurP|j}|��rPt|dd�dS)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�)r:rpr%r(r#r[r)rxr�rzrDZ
passed_dirr7r7r8�pytest_sessionfinish+s
���r�T)ZtryfirstZhookwrapper)�itemccs,dV}|��}i}|j|j�t|�|j<dSr0)Z
get_resultZpassedr��
setdefaultr�Zwhen)r�r��outcome�result�emptyr7r7r8�pytest_runtest_makereport?sr�)<riZdataclassesr1r�r]�pathlibr�shutilr�typingrrrrrr	Z
_pytest.nodesr
Z_pytest.reportsrZ
_pytest.stashrZtyping_extensionsr
r'Z_pytest.config.argparsingrrrrrrZ_pytest.compatrrZ_pytest.configrrrZ_pytest.deprecatedrZ_pytest.fixturesrr Z_pytest.monkeypatchr!r4rkr�Z	dataclassr"r^rrrwrzr�r�r>r�r�r7r7r7r8�<module>sd
�'


Youez - 2016 - github.com/yon3zu
LinuXploit