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/sphinx/testing/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/sphinx/testing/__pycache__/fixtures.cpython-39.opt-1.pyc
a

�abA�	@sdZddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
ddlZddlmZddlmZmZd	d
gZdd�Zejd
d�ed�dd��ZGdd�d�Zeje	eeeee
eefd�dd��Zeje	ed�dd��Zejdd�ee
eefe
eeeddfd�dd��Zejdd�eed�dd ��Zejdd�eed�d!d"��Ze��ee	ee
ddfd#�d$d%��Zejed�d&d'��Z ejd(d)d*�dd�d+d,��Z!ejedd�d-d.��Z"ejd
d�e	d/d0�d1d2��Z#ejed/d3�d4d5��Z$ejd6d7��Z%dS)8z�
    sphinx.testing.fixtures
    ~~~~~~~~~~~~~~~~~~~~~~~

    Sphinx test fixtures for pytest

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
namedtuple)�StringIO)�PIPE)�Any�Callable�Dict�	Generator�Tuple)�util)�
SphinxTestApp�#SphinxTestAppWrapperForSkipBuildingz�sphinx(builder, testroot=None, freshenv=False, confoverrides=None, tags=None, docutilsconf=None, parallel=0): arguments to initialize the sphinx test application.z0test_params(shared_result=...): test parameters.cCstD]}|�d|�qdS)zRegister custom markers�markersN)�DEFAULT_ENABLED_MARKERSZaddinivalue_line)�configZmarker�r�;/usr/lib/python3.9/site-packages/sphinx/testing/fixtures.py�pytest_configure srZsession)�scope)�returncCsdS�Nrrrrr�rootdir&src@sTeZdZUiZeeeeeffed<eeed�dd�Z	eeee
fd�dd�ZdS)	�SharedResult�cache)�key�app_rcCs2||jvrdS|j��|j��d�}||j|<dS)N��status�warning)r�_status�getvalue�_warning)�selfrr�datarrr�store.s
�zSharedResult.store)rrcCs2||jvriS|j|}t|d�t|d�d�S)Nrrr)rr)r!rr"rrr�restore7s



�zSharedResult.restoreN)�__name__�
__module__�__qualname__rr�str�__annotations__rrr#rr$rrrrr+s
	r)�request�test_params�
shared_result�sphinx_test_tempdirrrcs"t|jd�r|j�d�}n|j�d�}i�i}|durptt|��D],}t|j�D]\}}	|	�|<qP|�|j	�qB�fdd�t
����D�}
|dr�d|vr�t�
d��|d|d<|�|d�}|�|�|�d	d
�}||�d|�|d<}
|�r|
���s|d|}|�|
�tdd
�|
|�S)zp
    Parameters that are specified by 'pytest.mark.sphinx' for
    sphinx.application.Sphinx initialization
    �iter_markersZsphinxNcsg|]}�|�qSrr)�.0�i�Zpargsrr�
<listcomp>Y�zapp_params.<locals>.<listcomp>r,�srcdirz:You can not specify shared_result and srcdir in same time.�testroot�rootztest-�
app_paramszargs,kwargs)�hasattr�noder.�
get_marker�reversed�list�	enumerate�args�update�kwargs�sorted�keys�pytest�	Exceptionr$�pop�get�exists�copytreer)r*r+r,r-rr
r@�infor0�ar>r$r5r4Z
testroot_pathrr1rr7As.




r7)r*rcCsjt|jd�r|j�d�}n|j�d�}|r0|jni}ddi}|�|�|drft|dt�sft�	d��|S)au
    Test parameters that are specified by 'pytest.mark.test_params'

    :param Union[str] shared_result:
       If the value is provided, app._status and app._warning objects will be
       shared in the parametrized test functions and/or test functions that
       have same 'shared_result' value.
       **NOTE**: You can not specify both shared_result and srcdir.
    �get_closest_markerr+r,Nz@You can only provide a string type of value for "shared_result" )
r8r9rKr:r@r?�
isinstancer(rCrD)r*�envr@�resultrrrr+qs�

r+�function)r+r7�make_appr,rccs�|\}}||i|��}|Vtd|�dd��td|jj�td|j�td|j�tdd|j���td	d|j���|d
r�|�	|d
|�dS)z9
    Provides the 'sphinx.application.Sphinx' object
    z# testroot:r5r6z
# builder:z	# srcdir:z	# outdir:z	# status:�
z
# warning:r,N)
�printrFZbuilder�namer4Zoutdirrrr r#)r+r7rPr,r>r@rrrr�app�srT)rTrcCs|jS�zJ
    Back-compatibility for testing with previous @with_app decorator
    )r�rTrrrr�srcCs|jSrU)r rVrrrr�sr)r+�monkeypatchrc#s^|�ddd��g�tjdd�}��fdd�}|V|tjdd�<t��D]}|��qLdS)z�
    Provides make_app function to initialize SphinxTestApp instance.
    if you want to initialize 'app' in your test function. please use this
    instead of using SphinxTestApp class directory.
    zsphinx.application.abspathcSs|Srr)�xrrr�<lambda>�r3zmake_app.<locals>.<lambda>NcsRt�t�}}|�d|�|�d|�t|i|��}��|��drNt|�}|S)Nrrr,)r�
setdefaultr�appendr)r>r@rrr�Zappsr+rr�make�s
zmake_app.<locals>.make)�setattr�sys�pathr;Zcleanup)r+rWZsyspathr]rrr\rrP�s	rPcCst�Sr)rrrrrr,�sr,�moduleT)rZautousecCstj��dSr)rr�clearrrrr�_shared_result_cache�srccCsRt|jdd�}z"|r.tj|dgttd�WdSWntyBYn0t�d�dS)zt
    The test will be skipped when using 'if_graphviz_found' fixture and graphviz
    dot command is not found.
    �graphviz_dot�z-V)�stdout�stderrNzgraphviz "dot" is not available)�getattrr�
subprocess�runr�OSErrorrC�skip)rTrdrrr�if_graphviz_found�s
rmz	util.path)�tmpdir_factoryrcCs|��}t�|���S)z8
    Temporary directory wrapped with `path` class.
    )Zgetbasetempr
r`�abspath)rn�tmpdirrrrr-�sr-)rprcCs
t�|�S)z�
    Temporary directory wrapped with `path` class.
    This fixture is for back-compatibility with old test implementation.
    )r
r`)rprrr�tempdir�srqc
csdz8ttj�}dVWttj�D]}||vrtj�|�qn&ttj�D]}||vrDtj�|�qD0dS)z�
    Rollback sys.modules to its value before testing to unload modules
    during tests.

    For example, used in test_ext_autosummary.py to permit unloading the
    target module to clear its cache.
    N)r<r_�modulesrE)Z
sysmodules�modnamerrr�rollback_sysmodules�s	
�rt)&�__doc__rir_�collectionsr�iorr�typingrrrrr	rCZsphinx.testingr
Zsphinx.testing.utilrrrrZfixturer(rrr7r+rTrrrPr,rcrmr-rqrtrrrr�<module>sX
�	
�/
�




Youez - 2016 - github.com/yon3zu
LinuXploit