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__/cacheprovider.cpython-39.pyc
a

05d�Q�@s$dZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lmZdd
lm
Z
ddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl m"Z"ddl#m$Z$ddl%m&Z&ddl%m'Z'ddl(m)Z)dZ*dZ+eej,Gdd �d ���Z-Gd!d"�d"�Z.Gd#d$�d$�Z/Gd%d&�d&�Z0Gd'd(�d(�Z1edd)�d*d+�Z2eee
e3efd,�d-d.�Z4ed/d0�edd,�d1d2��Z5e!e"e-d3�d4d5��Z6eee7d,�d6d7�Z8ee$e3d8�d9d:�Z9dS);z%Implementation of the cache provider.�N)�Path)�Dict)�	Generator)�Iterable)�List)�Optional)�Set)�Union�)�resolve_from_str)�rm_rf)�
CollectReport)�nodes)�TerminalWriter)�final)�Config)�ExitCode)�hookimpl)�Parser)�check_ispytest)�fixture)�FixtureRequest)�Session)�Module)�Package)�
TestReporta.# pytest cache directory #

This directory contains data from the pytest's cache plugin,
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.

**Do not** commit this to version control.

See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information.
s�Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by pytest.
# For information about cache directory tags, see:
#	https://bford.info/cachedir/spec.html
c@seZdZUdZejdd�Zeed<ejdd�Z	e
ed<dZdZdd�ee
e
d	d
�dd�Zedd�e
e
dd
�dd��Zed'ee
d	d�dd��Zedd�e
e
ed
�dd��Zdd�ee
ed	d�dd�Zeed�dd�Zeed�dd�Zed�dd �Zeed	d!�d"d#�Zd	d$�d%d&�Zd	S)(�Cachez Instance of the `cache` fixture.F)�repr�	_cachedir�_config�d�v��	_ispytestN)�cachedir�configr#�returncCst|�||_||_dS�N)rrr)�selfr$r%r#�r)�9/usr/lib/python3.9/site-packages/_pytest/cacheprovider.py�__init__CszCache.__init__)r%r#r&cCsDt|�|j|dd�}|�d�r6|��r6|j|dd�|||dd�S)zHCreate the Cache instance for a Config.

        :meta private:
        Tr"�
cacheclear)r�cache_dir_from_config�	getoption�is_dir�clear_cache)�clsr%r#r$r)r)r*�
for_configJs
zCache.for_config)r$r#r&cCs6t|�|j|jfD]}||}|��rt|�qdS)zfClear the sub-directories used to hold cached directories and values.

        :meta private:
        N)r�_CACHE_PREFIX_DIRS�_CACHE_PREFIX_VALUESr/r)r1r$r#�prefixr r)r)r*r0Vs
zCache.clear_cachecCst|�t|�d�|j�S)zRGet the path to the cache directory for a Config.

        :meta private:
        �	cache_dir)rr�getini�rootpath)r%r#r)r)r*r-bszCache.cache_dir_from_config)�fmtr#�argsr&cKsLt|�ddl}ddlm}|j||r6|jfi|��n|�|jjdd�dS)z7Issue a cache warning.

        :meta private:
        rN)�PytestCacheWarning�)�
stacklevel)r�warningsZ_pytest.warning_typesr;�warn�formatr�hook)r(r9r#r:r>r;r)r)r*r?ks�z
Cache.warn)�namer&cCs@t|�}t|j�dkrtd��|j�|j|�}|jddd�|S)a�Return a directory path object with the given name.

        If the directory does not yet exist, it will be created. You can use
        it to manage files to e.g. store/retrieve database dumps across test
        sessions.

        .. versionadded:: 7.0

        :param name:
            Must be a string not containing a ``/`` separator.
            Make sure the name contains your plugin or application
            identifiers to prevent clashes with other cache users.
        r
z.name is not allowed to contain path separatorsT��exist_ok�parents)r�len�parts�
ValueErrorr�joinpathr3�mkdir)r(rB�path�resr)r)r*rJzszCache.mkdir)�keyr&cCs|j�|jt|��Sr')rrIr4r)r(rMr)r)r*�
_getvaluepath�szCache._getvaluepath)rMc	Csh|�|�}z>|jddd��}t�|�Wd�WS1s<0YWnttfyb|YS0dS)a�Return the cached value for the given key.

        If no value was yet cached or the value cannot be read, the specified
        default is returned.

        :param key:
            Must be a ``/`` separated value. Usually the first
            name is the name of your plugin or your application.
        :param default:
            The value to return in case of a cache-miss or invalid cache value.
        �r�UTF-8��encodingN)rN�open�json�loadrH�OSError)r(rM�defaultrK�fr)r)r*�get�s
.z	Cache.get)rM�valuer&cCs�|�|�}z.|j��rd}n|j��}|jjddd�Wn$ty\|jd|dd�YdS0|sj|��t	j
|ddd�}z|jd	d
d�}Wn"ty�|jd|dd�Yn00|�|�|�Wd�n1s�0YdS)
aNSave value for the given key.

        :param key:
            Must be a ``/`` separated value. Usually the first
            name is the name of your plugin or your application.
        :param value:
            Must be of any combination of basic python types,
            including nested types like lists of dictionaries.
        TrCz"could not create cache path {path})rKr#NF�)Zensure_ascii�indent�wrPrQz!cache could not write path {path})
rN�parentr/r�existsrJrVr?�_ensure_supporting_filesrT�dumpsrS�write)r(rMrZrKZcache_dir_exists_already�datarXr)r)r*�set�s$



z	Cache.set�r&cCsP|jd}|jtdd�|j�d�}d}|j|dd�|j�d�}|�t�dS)zOCreate supporting files in the cache dir that are not really part of the cache.z	README.mdrPrQz
.gitignorez%# Created by pytest automatically.
*
zCACHEDIR.TAGN)r�
write_text�README_CONTENTrI�write_bytes�CACHEDIR_TAG_CONTENT)r(Zreadme_pathZgitignore_path�msgZcachedir_tag_pathr)r)r*r`�s
zCache._ensure_supporting_files)F)�__name__�
__module__�__qualname__�__doc__�dataclassesZfieldrr�__annotations__rrr3r4�boolr+�classmethodr2r0�staticmethodr-�str�objectr?rJrNrYrdr`r)r)r)r*r5s,
��rc@s6eZdZddd�dd�Zedd�ejd�d	d
��ZdS)�LFPluginCollWrapper�LFPluginN��lfpluginr&cCs||_d|_dS)NF)ry�_collected_at_least_one_failure�r(ryr)r)r*r+�szLFPluginCollWrapper.__init__T)�hookwrapper)�	collectorc#s�t|t�r>dV}|��}|jj�t|j�fdd�dd�|_dSt|t�r�|j|jjvr�dV}|��}|j}|jj	�|j
s�t�fdd�|D��s�dS|jjj
�t|j�d�d|_
|j���fdd	�|D�|dd�<dSdVdS)
Ncs
|j�vSr')rK)�x)�lf_pathsr)r*�<lambda>��z@LFPluginCollWrapper.pytest_make_collect_report.<locals>.<lambda>T�rM�reversec3s|]}|j�vVqdSr'��nodeid��.0r~)�
lastfailedr)r*�	<genexpr>�r�zALFPluginCollWrapper.pytest_make_collect_report.<locals>.<genexpr>zlfplugin-collskipcs2g|]*}|j�vs*��|j�s*t|tj�r|�qSr))r�Z
isinitpathrK�
isinstancer�	Collectorr�)r��sessionr)r*�
<listcomp>�s

�zBLFPluginCollWrapper.pytest_make_collect_report.<locals>.<listcomp>)r�rZ
get_resultry�_last_failed_paths�sorted�resultrrKr�rz�anyr%�
pluginmanager�register�LFPluginCollSkipfilesr�)r(r}�outrLr�r))r�rr�r*�pytest_make_collect_report�s:

�


��	z.LFPluginCollWrapper.pytest_make_collect_report)rkrlrmr+rrr�r�r)r)r)r*rv�srvc@s6eZdZddd�dd�Zeejeed�dd��Z	dS)	r�rwNrxcCs
||_dSr')ryr{r)r)r*r+szLFPluginCollSkipfiles.__init__)r}r&cCsHt|t�rDt|t�sD|j|jjvrD|jjd7_t|jddgd�SdS)Nr
�passed)Zlongreprr�)	r�rrrKryr��_skipped_filesr
r�)r(r}r)r)r*r�	s
�z0LFPluginCollSkipfiles.pytest_make_collect_report)
rkrlrmr+rrr�rr
r�r)r)r)r*r�s
�r�c@s�eZdZdZedd�dd�Zeed�dd�Ze	e
d�d	d
�Zedd�dd
�Z
edd�dd�Zeddd�eeejedd�dd��Zedd�dd�ZdS)rwz;Plugin which implements the --lf (run last-failing) option.N�r%r&csx�|_d}t�fdd�|D��|_�js,J��j�di�|_d|_d|_d|_��	d�rt|�
�|_�j�
t|�d�dS)N)�lf�failedfirstc3s|]}��|�VqdSr')r.)r�rM�r%r)r*r� r�z$LFPlugin.__init__.<locals>.<genexpr>�cache/lastfailedrr�zlfplugin-collwrapper)r%r��active�cacherYr��_previously_failed_count�_report_statusr�r.�get_last_failed_pathsr�r�r�rv)r(r%Zactive_keysr)r�r*r+s


�zLFPlugin.__init__recs*|jj��fdd�|jD�}dd�|D�S)z@Return a set with all Paths()s of the previously failed nodeids.csh|]}�|�d�d�qS)z::r)�split)r�r��r8r)r*�	<setcomp>0r�z1LFPlugin.get_last_failed_paths.<locals>.<setcomp>cSsh|]}|��r|�qSr))r_r�r)r)r*r�1r�)r%r8r�)r(r�r)r�r*r�-szLFPlugin.get_last_failed_pathscCs$|jr |j�d�dkr d|jSdS)N�verboserzrun-last-failure: %s)r�r%r.r�)r(r)r)r*�pytest_report_collectionfinish3s
z'LFPlugin.pytest_report_collectionfinish)�reportr&cCs>|jdkr|js|jr(|j�|jd�n|jr:d|j|j<dS)N�callT)Zwhenr��skippedr��popr�Zfailed)r(r�r)r)r*�pytest_runtest_logreport8sz!LFPlugin.pytest_runtest_logreportcCsR|jdv}|rB|j|jvrN|j�|j�|j�dd�|jD��nd|j|j<dS)N)r�r�css|]}|jdfVqdS)TNr��r��itemr)r)r*r�Cr�z0LFPlugin.pytest_collectreport.<locals>.<genexpr>T)�outcomer�r�r��updater�)r(r�r�r)r)r*�pytest_collectreport>s
zLFPlugin.pytest_collectreportT�r|�tryfirst�NNN)r%�itemsr&c	csvdV|jsdS|j�rg}g}|D]&}|j|jvr@|�|�q$|�|�q$t|�|_|sndt|j�f|_nr|j�d�r�||dd�<|j	j
|d�n|||dd�<|jdkr�dnd}|j�d�r�dnd	}d
j|j||d�|_|jdk�rr|jdkr�d
nd}|jdj|j|d�7_nXd|_|j�d�dk�rd|jd7_|j	j
|dd�d�g|dd�<n|jd7_dS)Nz'%d known failures not in selected testsr�)r�r
ZfailureZfailuresr�z first�z%rerun previous {count} {noun}{suffix})�count�suffix�nounr�file�filesz (skipped {files} {files_noun}))r��
files_nounzno previously failed tests, �last_failed_no_failures�nonezdeselecting all items.znot deselecting items.)
r�r�r��appendrFr�r�r%r.rAZpytest_deselectedr@r�)	r(r%r�Zpreviously_failedZpreviously_passedr�r�r�r�r)r)r*�pytest_collection_modifyitemsGsF
�
�
�z&LFPlugin.pytest_collection_modifyitems)r�r&cCsX|j}|�d�st|d�rdS|jdus,J�|j�di�}||jkrT|j�d|j�dS)N�	cacheshow�workerinputr�)r%r.�hasattrr�rYr�rd)r(r�r%Zsaved_lastfailedr)r)r*�pytest_sessionfinish{s
zLFPlugin.pytest_sessionfinish)rkrlrmrnrr+rrr�rrtr�rr�r
r�rrr�Itemrr�rr�r)r)r)r*rws	

�3rwc@speZdZdZedd�dd�Zeddd�eej	e
dd	�d
d��Zeej	eej	d	�dd
�Z
dd�dd�ZdS)�NFPluginz8Plugin which implements the --nf (run new-first) option.Nr�cCs6||_|jj|_|jdusJ�t|j�dg��|_dS)N�
cache/nodeids)r%�option�newfirstr�r�rdrY�cached_nodeids�r(r%r)r)r*r+�s
zNFPlugin.__init__Tr�r�)r�r&ccs�dV|jrri}i}|D]&}|j|jvr4|||j<q|||j<q|�|���|�|���|dd�<|j�|�n|j�dd�|D��dS)Ncss|]}|jVqdSr'r�r�r)r)r*r��r�z9NFPlugin.pytest_collection_modifyitems.<locals>.<genexpr>)r�r�r��_get_increasing_order�valuesr�)r(r�Z	new_itemsZother_itemsr�r)r)r*r��s��z&NFPlugin.pytest_collection_modifyitemscCst|dd�dd�S)NcSs|j��jSr')rK�stat�st_mtime)r�r)r)r*r��r�z0NFPlugin._get_increasing_order.<locals>.<lambda>Tr�)r�)r(r�r)r)r*r��szNFPlugin._get_increasing_orderrecCsR|j}|�d�st|d�rdS|�d�r,dS|jdus:J�|j�dt|j��dS)Nr�r�Zcollectonlyr�)r%r.r�r�rdr�r�r�r)r)r*r��s
zNFPlugin.pytest_sessionfinish)rkrlrmrnrr+rrrr�rr�rr�r�r)r)r)r*r��s
�r�)�parserr&c	Cs�|�d�}|jdddddd�|jdd	dd
dd�|jdd
dddd�|jdddddd�|jddddd�d}dtjvr�tj�tjd|�}|jd|dd�|jddd d!d"d#d$d%�dS)&NZgeneralz--lfz
--last-failed�
store_truer�zHRerun only the tests that failed at the last run (or all if none failed))�action�dest�helpz--ffz--failed-firstr�zyRun all tests, but run the last failures first. This may re-order tests and thus lead to repeated fixture setup/teardown.z--nfz--new-firstr�zORun tests from new files first, then the rest of the tests sorted by file mtimez--cache-showr��?r�z_Show cache contents, don't perform collection or tests. Optional argument: glob (default: '*').)r��nargsr�r�z
--cache-clearr,z.Remove all cache contents at start of test run�
.pytest_cacheZTOX_ENV_DIRr6zCache directory path)rWr�z--lfnfz--last-failed-no-failures�storer�)�allr�r�z6Which tests to run with no previously (known) failures)r�r��choicesrWr�)ZgetgroupZ	addoption�os�environrK�joinZaddini)r��groupZcache_dir_defaultr)r)r*�pytest_addoption�s`
��	��
�
�r�r�cCs*|jjr&|jjs&ddlm}||t�SdS)Nr)�wrap_session)r�r�r��_pytest.mainr�)r%r�r)r)r*�pytest_cmdline_main�s
r�T)r�cCs8tj|dd�|_|j�t|�d�|j�t|�d�dS)NTr"ryZnfplugin)rr2r�r�r�rwr�r�r)r)r*�pytest_configure�sr�)�requestr&cCs|jjdusJ�|jjS)abReturn a cache object that can persist state between testing sessions.

    cache.get(key, default)
    cache.set(key, value)

    Keys must be ``/`` separated strings, where the first part is usually the
    name of your plugin or application to avoid clashes with other cache users.

    Values can be any object handled by the json stdlib module.
    N)r%r�)r�r)r)r*r��sr�cCsf|jjdks|�d�dkrb|jdus(J�|jj}z|�|j�}WntyV|}Yn0d|��SdS)z6Display cachedir with --cache-show and if non-default.rr6r�N�
cachedir: )r�r�r7r�r�relative_tor8rH)r%r$Zdisplaypathr)r)r*�pytest_report_header
s

r�)r%r�r&cCs�ddlm}|jdusJ�t�}|�dt|jj��|jj��sP|�d�dS|jj	d}|durhd}t
�}|jj}|tj}|�
dd|�tdd	�|�|�D��D]f}t|�|��}	|j�|	|�}
|
|ur�|�d
|	�q�|�d|	�||
���D]}|�d|�q�q�|tj}|���r�t|�|��}
|�
dd
|�|
D]:}|���rFt|�|��}	|�|	�d|��jd����qFdS)Nr)�pformatr�zcache is empty�*�-zcache values for %rcss|]}|��r|VqdSr')�is_filer�r)r)r*r�0r�zcacheshow.<locals>.<genexpr>z/%s contains unreadable content, will be ignoredz%s contains:z  zcache directories for %rz is a file of length r )Zpprintr�r�r�linertrr/r�r�rurr4�sepr��rglobr�rY�
splitlinesr3r�r��st_size)r%r�r�Ztw�globZdummyZbasedirZvdirZvalpathrM�valr��ddir�contents�pr)r)r*r�s>




 r�):rnrorTr��pathlibr�typingrrrrrrr	rrZreportsr
Z_pytestrZ_pytest._iorZ_pytest.compatrZ_pytest.configrrrZ_pytest.config.argparsingrZ_pytest.deprecatedrZ_pytest.fixturesrrr�rZ_pytest.pythonrrZ_pytest.reportsrrgriZ	dataclassrrvr�rwr�r��intr�r�r�rtr�r�r)r)r)r*�<module>s\4l.:

Youez - 2016 - github.com/yon3zu
LinuXploit