GhostManSec
Server: Apache
System: Linux s323.xrea.com 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: moonarc (17751)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyo
�
��abc@`s�dZddlmZmZmZddlZddlZddlZddlZddl	m
ZmZ
defd��YZdefd��YZd	�Zd
�Zejde�d��Zejd
��Zd�Zd�ZdS(s�
merged implementation of the cache provider

the name cache was not chosen to ensure pluggy automatically
ignores the external pytest-cache
i(tabsolute_importtdivisiontprint_functionN(tseptaltseptCachecB`sDeZd�Zed��Zd�Zd�Zd�Zd�ZRS(cC`s�||_tj|�|_|jjjd�|_|jd�r~|jd�|jj�rn|jj	�n|jj
�ndS(Ntcachet
cacheclearsclearing cachedir(tconfigRtcache_dir_from_configt	_cachedirttracetroottgett	getoptiontchecktremovetmkdir(tselfR((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyt__init__s	
cC`si|jd�}tjj|�}tjj|�}tjj|�rUtjj|�S|jj	|�SdS(Nt	cache_dir(
tgetinitostpatht
expandusert
expandvarstisabstpytlocaltrootdirtjoin(RR((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyR	scC`sFt|ks$tdk	r3t|kr3td��n|jjd|�S(s� 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 likes e. g. store/retrieve database
        dumps across test sessions.

        :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.
        s.name is not allowed to contain path separatorstdN(t_sept_altseptNonet
ValueErrorR
t
ensure_dir(Rtname((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytmakedir$s
$cC`s|jjd|jd��S(Ntvt/(R
Rtsplit(Rtkey((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyt
_getvaluepath2scC`ss|j|�}|j�roy)|jd��}tj|�SWdQXWqotk
rk|jd|f�qoXn|S(s� return 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: must be provided in case of a cache-miss or
             invalid cache values.

        trNscache-invalid at %s(R+RtopentjsontloadR#R(RR*tdefaultRtf((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyR
5s
cC`s�|j|�}y|j�j�WnDtjjtjjfk
ri|jjdddd|f�dSXy|j	d�}Wn7tjj
k
r�|jjdddd|f�nAX|�8|jd||f�tj
||d	d
dt�WdQXdS(sP save 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 e. g. lists of dictionaries.
        tcodetI9tmessagescould not create cache path %sNtwscache could not write path %sscache-write %s: %rtindentit	sort_keys(R+tdirpathR$RterrortEEXISTtEACCESRtwarnR-tENOTDIRRR.tdumptTrue(RR*tvalueRR1((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytsetIs	(	t__name__t
__module__RtstaticmethodR	R&R+R
RA(((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyRs	

			tLFPlugincB`sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s< Plugin which implements the --lf (run last-failing) option c`sS�|_d}t�fd�|D��|_�jjdi�|_d|_dS(Ntlftfailedfirstc3`s|]}�j|�VqdS(N(R(t.0R*(R(s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pys	<genexpr>ksscache/lastfailed(RFRG(RtanytactiveRR
t
lastfailedR"t_previously_failed_count(RRtactive_keys((Rs9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyRhs
	cC`s�|jr}|jsd}nZ|jdkr0dnd}|jjd�rNdnd}djd	|jd
|d|�}d|SdS(
Nsrun all (no recorded failures)itfailuretfailuresRGs firstts%rerun previous {count} {noun}{suffix}tcounttsuffixtnounsrun-last-failure: %s(RJRLRRtformat(RtmodeRSRR((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_report_collectionfinishos					cC`sZ|jdkr|js!|jr:|jj|jd�n|jrVt|j|j<ndS(Ntcall(	twhentpassedtskippedRKtpoptnodeidR"tfailedR?(Rtreport((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_runtest_logreport|s!	cC`sq|jdk}|r]|j|jkrm|jj|j�|jjd�|jD��qmnt|j|j<dS(NRYRZcs`s|]}|jtfVqdS(N(R\R?(RHtitem((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pys	<genexpr>�s(RYRZ(toutcomeR\RKR[tupdatetresultR?(RR^RY((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_collectreport�s	cC`s�|jr�|jr�g}g}x=|D]5}|j|jkrM|j|�q%|j|�q%Wt|�|_|swdS|jjd�r�||(|jj	d|�q�|||(ndS(NRFtitems(
RJRKR\tappendtlenRLRRthooktpytest_deselected(RtsessionRRetpreviously_failedtpreviously_passedR`((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_collection_modifyitems�s
cC`sl|j}|jd�s't|d�r+dS|jjdi�}||jkrh|jjd|j�ndS(Nt	cacheshowt
slaveinputscache/lastfailed(RRthasattrRR
RKRA(RRjRtsaved_lastfailed((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_sessionfinish�s	(	RBRCt__doc__RRVR_RdRmRr(((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyREes		
			c	C`s�|jd�}|jdddddddd	�|jd
ddddddd
�|jddddddd�|jddddddd�|jddddd�dS(Ntgenerals--lfs
--last-failedtactiont
store_truetdestRFthelpsHrerun only the tests that failed at the last run (or all if none failed)s--ffs--failed-firstRGsxrun all tests but run the last failures first.  This may re-order tests and thus lead to repeated fixture setup/teardowns--cache-showRns6show cache contents, don't perform collection or testss
--cache-clearRs/remove all cache contents at start of test run.RR0s
.pytest_cachescache directory path.(tgetgroupt	addoptiontaddini(tparsertgroup((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_addoption�s cC`s-|jjr)ddlm}||t�SdS(Ni(twrap_session(toptionRnt_pytest.mainR(RR((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_cmdline_main�sttryfirstcC`s,t|�|_|jjt|�d�dS(Ntlfplugin(RRt
pluginmanagertregisterRE(R((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_configure�scC`s
|jjS(sg
    Return a cache object that can persist state between testing sessions.

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

    Keys must be a ``/`` separated value, 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.
    (RR(trequest((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyR�s
cC`s6|jjr2tjj�j|jj�}d|SdS(Nscachedir: %s(R�tverboseRRRtbestrelpathRR
(Rtrelpath((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pytpytest_report_header�scC`sddlm}tjj�}|jdt|jj��|jjj�s_|jd�dSt	�}|jj}|j
d�}|jdd�x�t|j
d���D]�}|j|�j|jd	�}|jj||�}	|	|kr|jd
|�q�|jd|�tjj�}
||	d|
�x+|
j�j�D]}|jd
|�qHWq�W|j
d�}|j�r|j�r|jdd�xat|j
d�j
��D]A}
|
j�r�|
j|�}|jd||
j�f�q�q�WndS(Ni(tpprints
cachedir: scache is emptyR't-scache valuescS`s
|j�S(N(tisfile(tx((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyt<lambda>�RPR(s/%s contains unreadable content, will be ignoreds%s contains:tstreams  Rscache directoriess%s is a file of length %d(R�RtiotTerminalWritertlinetstrRR
RtobjectRRtsortedtvisittreltotreplaceR
tTextIOtgetvaluet
splitlinestisdirtlistdirR�tsize(RRjR�ttwtdummytbasedirtvdirtvalpathR*tvalR�R�tddirtp((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyRn�s<
		"	(Rst
__future__RRRRtpytestR.Rtos.pathRR RR!R�RRER~R�thookimplR?R�tfixtureRR�Rn(((s9/usr/lib/python2.7/site-packages/_pytest/cacheprovider.pyt<module>sVF