403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.217.6
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib64/python3.7/site-packages/aiohttp/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib64/python3.7/site-packages/aiohttp/__pycache__/pytest_plugin.cpython-37.pyc
B

�Z�_+�@s�ddlZddlZddlZddlmZddlZddlmZmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZmZyddlZWnek
r�dZYnXyddlZWnek
r�dZYnXdd�Zd	d
�Zejdd��Zejd
d��Zejdd��Zejd.dd��Zdd�Z dd�Z!dd�Z"ejdd��Z#ejdd��Z$ejdd��Zejd d!��Z%ejd"d#��Z&ejd$d%��Z'ejd&d'��Z(ejd(d)��Z)ejd*d+��Z*ejd,d-��Z+dS)/�N)�Callable)�PY_37�isasyncgenfunction)�Application�)�BaseTestServer�
RawTestServer�
TestClient�
TestServer�loop_context�setup_test_loop�teardown_test_loop�unused_portcCs:|jddddd�|jdddd	d�|jd
dddd�dS)Nz--aiohttp-fast�
store_trueFz*run tests faster by disabling extra checks)�action�default�helpz--aiohttp-loopZstore�pyloopz:run tests with specific loop: pyloop, uvloop, tokio or allz--aiohttp-enable-loop-debugzenable event loop debug mode)Z	addoption)�parser�r�H/opt/alt/python37/lib64/python3.7/site-packages/aiohttp/pytest_plugin.py�pytest_addoption!srcsb|j�t��rd�nt���r$d�ndSd�d|jkrH|jd7_d����fdd�}||_dS)zS
    Allow fixtures to be coroutines. Run coroutine fixtures in an event loop.
    TFN�request)rcsv|d}�r|d=d|jkr$td��|�d���rb�||����fdd�}|�|�������S���||��SdS)Nr�loopz^Asynchronous fixtures must depend on the 'loop' fixture or be used in tests depending from it.cs(y������Stk
r"YnXdS)N)�run_until_complete�	__anext__�StopAsyncIterationr)�_loop�genrr�	finalizer`sz8pytest_fixture_setup.<locals>.wrapper.<locals>.finalizer)�fixturenames�	ExceptionZgetfixturevalueZaddfinalizerrr)�args�kwargsrr)�func�is_async_gen�
strip_request)rrr�wrapperKs



z%pytest_fixture_setup.<locals>.wrapper)r$r�asyncio�iscoroutinefunction�argnames)Z
fixturedefr'r)r$r%r&r�pytest_fixture_setup6s

 r+cCs|j�d�S)z--fast config optionz--aiohttp-fast)�config�	getoption)rrrr�fastnsr.cCs|j�d�S)z!--enable-loop-debug config optionz--aiohttp-enable-loop-debug)r,r-)rrrr�
loop_debugtsr/c	cs`tjdd��J}dVdd�|D�}|rRtd�t|�t|�dkrBdnd	d
�|����WdQRXdS)z�
    Context manager which checks for RuntimeWarnings, specifically to
    avoid "coroutine 'X' was never awaited" warnings being missed.

    If RuntimeWarnings occur in the context a RuntimeError is raised.
    T)�recordNcSs"g|]}|jtkrdj|d��qS)z#{w.filename}:{w.lineno}:{w.message})�w)�category�RuntimeWarning�format)�.0r1rrr�
<listcomp>�sz,_runtime_warning_context.<locals>.<listcomp>z{} Runtime Warning{},
{}r��s�
)�warnings�catch_warnings�RuntimeErrorr4�len�join)�	_warningsZrwrrr�_runtime_warning_contextzsr@Fccs(|r|Vnt�}|Vt||d�dS)z{
    setups and tears down a loop unless one is passed in via the loop
    argument when it's passed straight through.
    )r.N)rr
)rr.rrr�_passthrough_loop_context�s
rAcCs(|�|�r$t�|�r$t|�||��SdS)z/
    Fix pytest collecting for coroutines.
    N)Zfuncnamefilterr(r)�listZ
_genfunctions)Z	collector�name�objrrr�pytest_pycollect_makeitem�srEc
s��j�d�}t��j�r��j�d�p0�j�dd�}t��Ft||d��.}�fdd��j	j
D�}|��jf|��WdQRXWdQRXdSdS)	zL
    Run coroutines in an event loop instead of a normal function call.
    z--aiohttp-fast�
proactor_looprN)r.csi|]}�j||�qSr)�funcargs)r5�arg)�
pyfuncitemrr�
<dictcomp>�sz&pytest_pyfunc_call.<locals>.<dictcomp>T)
r,r-r(r)ZfunctionrG�getr@rAZ_fixtureinfor*rrD)rIr.Z
existing_looprZtestargsr)rIr�pytest_pyfunc_call�s
&rLcCs�d|jkrdS|jjj}dtji}tdk	r4tj|d<tdk	rFtj|d<|dkrRd}i}x\|�	d�D]N}|�
d�}|�d	�}||kr�|rbtd
|t
|���f��nqb||||<qbW|jdt
|���t
|���d�dS)N�loop_factoryr�uvloop�tokio�allzpyloop,uvloop?,tokio?�,�?z ?z&Unknown loop '%s', available loops: %s)Zids)r r,ZoptionZaiohttp_loopr(ZDefaultEventLoopPolicyrNZEventLoopPolicyrO�split�endswith�strip�
ValueErrorrB�keysZparametrize�values)ZmetafuncZloopsZavail_factoriesZ	factoriesrCZrequiredrrr�pytest_generate_tests�s.





rYc	csH|�}t�|�t|d��$}|r*|�d�t�|�|VWdQRXdS)z%Return an instance of the event loop.)r.TN)r(�set_event_loop_policyrZ	set_debug�set_event_loop)rMr.r/�policyrrrrr�s


rc	csRtst��}tj|_nt��}t�|�t|j��}t�	|�|VWdQRXdS)N)
rr(Zget_event_loop_policyZProactorEventLoopZ
_loop_factoryZWindowsProactorEventLoopPolicyrZrZnew_event_loopr[)r\rrrrrF�s


rFcCstjdtdd�|S)Nz3Deprecated, use aiohttp_unused_port fixture instead�)�
stacklevel)r:�warn�DeprecationWarning)�aiohttp_unused_portrrrr�s
rcCstS)z1Return a port that is unused on the current host.)�_unused_portrrrrrasrac#s:g�dd���fdd�
}|V�fdd�}��|��dS)z^Factory to create a TestServer instance, given an app.

    aiohttp_server(app, **kwargs)
    N)�portc�s4t||d�}|jfd�i|��IdH��|�|S)N)rcr)r
�start_server�append)Zapprcr#�server)r�serversrr�gos
zaiohttp_server.<locals>.goc�s x�r�����IdHqWdS)N)�pop�closer)rgrr�finalizesz aiohttp_server.<locals>.finalize)r)rrhrkr)rrgr�aiohttp_server	s
rlcCstjdtdd�|S)Nz.Deprecated, use aiohttp_server fixture insteadr])r^)r:r_r`)rlrrr�test_server s
rmc#s:g�dd���fdd�
}|V�fdd�}��|��dS)zpFactory to create a RawTestServer instance, given a web handler.

    aiohttp_raw_server(handler, **kwargs)
    N)rcc�s4t||d�}|jfd�i|��IdH��|�|S)N)rcr)rrdre)Zhandlerrcr#rf)rrgrrrh2s
zaiohttp_raw_server.<locals>.goc�s x�r�����IdHqWdS)N)rirjr)rgrrrk:sz$aiohttp_raw_server.<locals>.finalize)r)rrhrkr)rrgr�aiohttp_raw_server*s
rncCstjdtdd�|S)Nz2Deprecated, use aiohttp_raw_server fixture insteadr])r^)r:r_r`)rnrrr�raw_test_serverAs
roc#s:g�dd���fdd�
}|V�fdd�}��|��dS)z�Factory to create a TestClient instance.

    aiohttp_client(app, **kwargs)
    aiohttp_client(server, **kwargs)
    aiohttp_client(raw_server, **kwargs)
    N)�
server_kwargsc�s�t|t�r.t|ttf�s.|�f|�|�}i}n|r:td��t|t�rv|pJi}t|fd�i|��}t|fd�i|��}n0t|t�r�t|fd�i|��}ntdt|���|�	�IdH��
|�|S)Nzargs should be emptyrzUnknown argument type: %r)�
isinstancerrr�AssertionErrorr
r	rV�typerdre)Z__paramrpr"r#rfZclient)�clientsrrrrhUs


zaiohttp_client.<locals>.goc�s x�r�����IdHqWdS)N)rirjr)rtrrrknsz aiohttp_client.<locals>.finalize)r)rrhrkr)rtrr�aiohttp_clientKs
rucCstjdtdd�|S)Nz.Deprecated, use aiohttp_client fixture insteadr])r^)r:r_r`)rurrr�test_clientus
rv)F),r(�
contextlibr:Zcollections.abcrZpytestZaiohttp.helpersrrZaiohttp.webrZ
test_utilsrrr	r
rrr
rrbrN�ImportErrorrOrr+Zfixturer.r/�contextmanagerr@rArErLrYrrFrarlrmrnrorurvrrrr�<module>sF(

8"


*

Youez - 2016 - github.com/yon3zu
LinuXploit