403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.139.59.149
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/pytest_plugin.cpython-38.pyc
U

'�7`+�@s�ddlZddlZddlZddlmZddlZddlmZmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZmZzddlZWnek
r�dZYnXz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)N�--aiohttp-fast�
store_trueFz*run tests faster by disabling extra checks)�action�default�helpz--aiohttp-loop�store�pyloopz:run tests with specific loop: pyloop, uvloop, tokio or all�--aiohttp-enable-loop-debugzenable event loop debug mode)Z	addoption)�parser�r�H/opt/alt/python38/lib64/python3.8/site-packages/aiohttp/pytest_plugin.py�pytest_addoption!s$���rcsb|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*z������WStk
r$YnXdS�N)�run_until_complete�	__anext__�StopAsyncIterationr��_loop�genrr�	finalizer`sz8pytest_fixture_setup.<locals>.wrapper.<locals>.finalizer)�fixturenames�	ExceptionZgetfixturevalueZaddfinalizerrr )�args�kwargsrr%��funcZis_async_genZ
strip_requestr"r�wrapperKs
�


z%pytest_fixture_setup.<locals>.wrapper)r+r�asyncio�iscoroutinefunction�argnames)Z
fixturedefr,rr*r�pytest_fixture_setup6s

 r0cCs|j�d�S)z--fast config optionr��config�	getoptionrrrr�fastnsr4cCs|j�d�S)z!--enable-loop-debug config optionrr1rrrr�
loop_debugtsr5c	cs`tjdd��J}dVdd�|D�}|rRtd�t|�t|�dkrBdnd	d
�|����W5QRXdS)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)�.0r7rrr�
<listcomp>�s
�z,_runtime_warning_context.<locals>.<listcomp>z{} Runtime Warning{},
{}r��s�
)�warnings�catch_warnings�RuntimeErrorr:�len�join)�	_warnings�rwrrr�_runtime_warning_contextzs���rGFccs(|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.
    �r4N)rr
)rr4rrr�_passthrough_loop_context�s
rIcCs(|�|�r$t�|�r$t|�||��SdS)z/
    Fix pytest collecting for coroutines.
    N)Zfuncnamefilterr-r.�listZ
_genfunctions)Z	collector�name�objrrr�pytest_pycollect_makeitem�srMc
s��j�d�}t��j�r��j�d�p0�j�dd�}t��Ft||d��.}�fdd��j	j
D�}|��jf|��W5QRXW5QRXdSdS)	zL
    Run coroutines in an event loop instead of a normal function call.
    r�
proactor_looprNrHcsi|]}|�j|�qSr)�funcargs)r;�arg��
pyfuncitemrr�
<dictcomp>�s�z&pytest_pyfunc_call.<locals>.<dictcomp>T)
r2r3r-r.�functionrO�getrGrIZ_fixtureinfor/rrL)rRr4Z
existing_loopr#ZtestargsrrQr�pytest_pyfunc_call�s��
�&rVcCs�d|jkrdS|jjj}dtji}tdk	r4tj|d<tdk	rFtj|d<|dkrRd}i}|�	d�D]N}|�
d�}|�d	�}||kr�|r`td
|t
|���f��nq`||||<q`|jdt
|���t
|���d�dS)N�loop_factoryr�uvloop�tokio�allzpyloop,uvloop?,tokio?�,�?z ?z&Unknown loop '%s', available loops: %s)Zids)r&r2�optionZaiohttp_loopr-ZDefaultEventLoopPolicyrXZEventLoopPolicyrY�split�endswith�strip�
ValueErrorrJ�keysZparametrize�values)ZmetafuncZloopsZavail_factoriesZ	factoriesrK�requiredrrr�pytest_generate_tests�s8





��

�rec	csH|�}t�|�t|d��$}|r*|�d�t�|�|VW5QRXdS)z%Return an instance of the event loop.rHTN)r-�set_event_loop_policyrZ	set_debug�set_event_loop)rWr4r5�policyr#rrrr�s


rc	csRtst��}tj|_nt��}t�|�t|j��}t�	|�|VW5QRXdSr)
rr-Zget_event_loop_policyZProactorEventLoopZ
_loop_factoryZWindowsProactorEventLoopPolicyrfrZnew_event_looprg)rhr#rrrrN�s


rNcCstjdtdd�|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_portrrrrrosroc#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�Nrqr)r
�start_server�append)Zapprrr)�server�r�serversrr�gos
zaiohttp_server.<locals>.goc�s�r�����IdHqdSr��pop�closer�rxrr�finalizesz aiohttp_server.<locals>.finalize�r�rryr~rrwr�aiohttp_server	s
r�cCstjdtdd�|S)Nz.Deprecated, use aiohttp_server fixture insteadrirjrl)r�rrr�test_server s�r�c#s:g�dd���fdd�
}|V�fdd�}��|��dS)zpFactory to create a RawTestServer instance, given a web handler.

    aiohttp_raw_server(handler, **kwargs)
    Nrqc�s4t||d�}|jfd�i|��IdH��|�|Srs)rrtru)�handlerrrr)rvrwrrry2s
zaiohttp_raw_server.<locals>.goc�s�r�����IdHqdSrrzrr}rrr~:sz$aiohttp_raw_server.<locals>.finalizerr�rrwr�aiohttp_raw_server*s
r�cCstjdtdd�|S)Nz2Deprecated, use aiohttp_raw_server fixture insteadrirjrl)r�rrr�raw_test_serverAs�r�c#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	ra�typertru)Z__paramr�r(r)rvZclient��clientsrrrryUs"�


zaiohttp_client.<locals>.goc�s�r�����IdHqdSrrzr)r�rrr~nsz aiohttp_client.<locals>.finalizerr�rr�r�aiohttp_clientKs
r�cCstjdtdd�|S)Nz.Deprecated, use aiohttp_client fixture insteadrirjrl)r�rrr�test_clientus�r�)F),r-�
contextlibr@�collections.abcr�pytestZaiohttp.helpersrrZaiohttp.webrZ
test_utilsrrr	r
rrr
rrprX�ImportErrorrYrr0Zfixturer4r5�contextmanagerrGrIrMrVrerrNror�r�r�r�r�r�rrrr�<module>s`(

8


"



	


	

	
)

Youez - 2016 - github.com/yon3zu
LinuXploit