
    2he2              
       6   S SK r S SKrS SKrS SKrS SKJrJrJrJrJ	r	J
r
JrJrJr  S SKrSSKJrJrJrJrJrJrJrJr  SSKJrJrJr  SSKJr   S SKr " S S\5      r! " S	 S
\5      r" " S S\5      r#S r$S r%\RL                  S 5       r'\RL                  S 5       r(\RR                  S 5       r*\RR                  S&S j5       r+S r,S r-S r.\RL                  S\/ \ R^                  4   S\0S\0S\	\ R^                     4S j5       r1\RL                  S\	\ R^                     4S j5       r2\RL                  S\/ \34   S\/ \34   4S j5       r\RL                  S\/ \34   4S j5       r4\RL                  S\ R^                  S\	\"   4S  j5       r5\RL                  S! 5       r6\RL                  S\ R^                  S\	\#   4S" j5       r7\RL                  S# 5       r8\RL                  S\ R^                  S\	\!   4S$ j5       r9\RL                  S% 5       r:g! \  a    Sr GNf = f)'    N)	Any	AwaitableCallableDictIteratorOptionalProtocolUnionoverload   )BaseTestServerRawTestServer
TestClient
TestServerloop_contextsetup_test_loopteardown_test_loopunused_port)ApplicationBaseRequestRequest)_RequestHandlerc                       \ rS rSr\SS.S\S\\\\	4      S\	S\
\\4   4S jj5       r\SS.S\S\\\\	4      S\	S\
\S4   4S	 jj5       rS
rg)AiohttpClient&   Nserver_kwargs_AiohttpClient__paramr   kwargsreturnc                   #    g 7fN selfr   r   r   s       M/var/www/auris/envauris/lib/python3.13/site-packages/aiohttp/pytest_plugin.py__call__AiohttpClient.__call__'   s
      ,/   c                   #    g 7fr"   r#   r$   s       r&   r'   r(   /   s
      ),r)   r#   )__name__
__module____qualname____firstlineno__r   r   r   r   strr   r   r   r'   r   r   __static_attributes__r#       r&   r   r   &   s    
 37	//  S#X/	/
 / 
G[(	)/ / 
 37	,,  S#X/	,
 , 
K%	&, ,r1   r   c            
       B    \ rS rSrSS.S\S\\   S\S\\	   4S jjr
S	rg)
AiohttpServer9   Nportappr6   r   r    c                    g r"   r#   )r%   r7   r6   r   s       r&   r'   AiohttpServer.__call__:   s     #r1   r#   )r+   r,   r-   r.   r   r   intr   r   r   r'   r0   r#   r1   r&   r3   r3   9   s8    9=$$)1#$IL$	:	$ $r1   r3   c            
       B    \ rS rSrSS.S\S\\   S\S\\	   4S jjr
S	rg)
AiohttpRawServer?   Nr5   handlerr6   r   r    c                    g r"   r#   )r%   r>   r6   r   s       r&   r'   AiohttpRawServer.__call__@   s    #&r1   r#   )r+   r,   r-   r.   r   r   r:   r   r   r   r'   r0   r#   r1   r&   r<   r<   ?   s8    AE'&'19#'QT'	=	!' 'r1   r<   c                 p    U R                  SSSSS9  U R                  SSSS	S9  U R                  S
SSSS9  g )N--aiohttp-fast
store_trueFz*run tests faster by disabling extra checks)actiondefaulthelpz--aiohttp-loopstorepyloopz3run tests with specific loop: pyloop, uvloop or all--aiohttp-enable-loop-debugzenable event loop debug mode)	addoption)parsers    r&   pytest_addoptionrL   E   sc    
9	   B	   %+	  r1   c                 
  ^^^ U R                   m[        R                  " T5      (       a  SmO[        R                  " T5      (       a  SmOgSmSU R                  ;  a  U =R                  S-  sl        SmUUU4S jnXl         g)zbSet up pytest fixture.

Allow fixtures to be coroutines. Run coroutine fixtures in an event loop.
TFNrequestrN   c                  8  >^^ US   nT(       a  US	 SUR                   ;  a  [        S5      eUR                  S5      mT(       a?  T" U 0 UD6mUU4S jnUR                  U5        TR	                  TR                  5       5      $ TR	                  T" U 0 UD65      $ )NrN   loopz^Asynchronous fixtures must depend on the 'loop' fixture or be used in tests depending from it.c                  d   >  T R                  TR                  5       5      $ ! [         a     g f = fr"   )run_until_complete	__anext__StopAsyncIteration)_loopgens   r&   	finalizer8pytest_fixture_setup.<locals>.wrapper.<locals>.finalizer   s1     33CMMODD) s   " 
//)fixturenames	ExceptiongetfixturevalueaddfinalizerrS   rT   )	argsr   rN   rX   rV   rW   funcis_async_genstrip_requests	       @@r&   wrapper%pytest_fixture_setup.<locals>.wrapperp   s    #y!
 ---6 
 ''/ ''C   +++CMMO<<++D$,A&,ABBr1   )r_   inspectisasyncgenfunctioniscoroutinefunctionargnames)
fixturedefrb   r_   r`   ra   s     @@@r&   pytest_fixture_setupri   Z   sv    
 ??D!!$''		$	$T	*	* 	M
+++|+C@ Or1   c                 8    U R                   R                  S5      $ )z--fast config optionrB   config	getoptionrO   s    r&   fastrn      s     >>##$455r1   c                 8    U R                   R                  S5      $ )z!--enable-loop-debug config optionrI   rk   rO   s    r&   
loop_debugrp      s     >>##$ABBr1   c            
   #   ~  #    [         R                  " SS9 n Sv   U  Vs/ s H(  nUR                  [        :X  d  M  SR	                  US9PM*     nnU(       aE  [        SR	                  [        U5      [        U5      S:X  a  SOS	S
R                  U5      5      5      e SSS5        gs  snf ! , (       d  f       g= f7f)zContext manager which checks for RuntimeWarnings.

This exists specifically to
avoid "coroutine 'X' was never awaited" warnings being missed.

If RuntimeWarnings occur in the context a RuntimeError is raised.
T)recordNz#{w.filename}:{w.lineno}:{w.message})wz{} Runtime Warning{},
{}r    s
)warningscatch_warningscategoryRuntimeWarningformatRuntimeErrorlenjoin)	_warningsrs   rws      r&   _runtime_warning_contextr      s      
	 	 	- 
zz^+ >18818= 	 

 +22G3r7a<RS$))B-   
.	-
 
.	-s3   B=	B,B'B'AB,	B='B,,
B:6B=c              #   R   #    U (       a  U v   g[        5       n U v   [        XS9  g7f)zPassthrough loop context.

Sets up and tears down a loop unless one is passed in via the loop
argument when it's passed straight through.
rn   N)r   r   )rQ   rn   s     r&   _passthrough_loop_contextr      s&      
  
4+s   %'c                     U R                  U5      (       a6  [        R                  " U5      (       a  [        U R	                  X5      5      $ gg)z%Fix pytest collecting for coroutines.N)funcnamefilterrd   rf   list_genfunctions)	collectornameobjs      r&   pytest_pycollect_makeitemr      sB    %%'*E*Ec*J*JI++D677 +K%r1   c           	         U R                   R                  S5      n[        R                  " U R                  5      (       a  U R
                  R                  S5      =(       d`    U R
                  R                  S5      =(       d>    U R
                  R                  S5      =(       d    U R
                  R                  SS5      n[        5          [        X!S9 nU R                  R                   Vs0 s H  nX@R
                  U   _M     nnUR                  U R                  " S	0 UD65        SSS5        SSS5        ggs  snf ! , (       d  f       N= f! , (       d  f       g= f)
zBRun coroutines in an event loop instead of a normal function call.rB   proactor_loopselector_loopuvloop_looprQ   Nr   Tr#   )rl   rm   rd   rf   functionfuncargsgetr   r   _fixtureinforg   rS   r   )
pyfuncitemrn   existing_looprV   argtestargss         r&   pytest_pyfunc_callr      s4   &&'78D"":#6#677##O4 5""&&75""&&}55 ""&&vt4	 	 &'*=D  *66??? ,,S11?   (()C()CD E ( ! 8 ED (' s6   
EE0D>	#E,E>E
E	E
E"c           
      J   SU R                   ;  a  g U R                  R                  R                  nS[        R
                  0n[        b  [        R
                  US'   US:X  a  Sn0 nUR                  S5       Hh  nUR                  S5      (       + nUR                  S5      nXB;  a3  U(       a*  [        S	U< S
[        UR                  5       5      < 35      eMb  X$   X4'   Mj     U R                  S[        UR                  5       5      [        UR                  5       5      S9  g )Nloop_factoryrH   uvloopallzpyloop,uvloop?,?z ?zUnknown loop 'z', available loops: )ids)rZ   rl   optionaiohttp_loopasyncionew_event_loopr   splitendswithstrip
ValueErrorr   keysparametrizevalues)metafuncloopsavail_factories	factoriesr   requireds         r&   pytest_generate_testsr      s   X222OO""//E!7!78O$*$9$9!~ IC }}S))zz$& T).."235 
 )/	 ! Y--/0d9>>;K6L  r1   r   rn   rp   r    c              #      #    [        XS9 nU(       a  UR                  S5        [        R                  " U5        Uv   SSS5        g! , (       d  f       g= f7f)z%Return an instance of the event loop.r   TN)r   	set_debugr   set_event_loop)r   rn   rp   rV   s       r&   rQ   rQ     s>      
l	.%OOD!u%	 
/	.	.s   
A3A	A
AAc               #      #    [         R                  n [        U 5       n[         R                  " U5        Uv   S S S 5        g ! , (       d  f       g = f7fr"   )r   ProactorEventLoopr   r   )factoryrV   s     r&   r   r     s8     ''G	g	%u% 
		s   AA	A
AAaiohttp_unused_portc                 :    [         R                  " S[        SS9  U $ )Nz3Deprecated, use aiohttp_unused_port fixture instead   
stacklevelrw   warnDeprecationWarning)r   s    r&   r   r     s    MM=
 r1   c                      [         $ )z1Return a port that is unused on the current host.)_unused_portr#   r1   r&   r   r   %  s
     r1   rQ   c              #      ^ ^#    / mSSS.S[         S[        S[        [           S[        S[
        4
U U4S	 jjjnUv   SU4S
 jjnT R                  U" 5       5        g7f)zVFactory to create a TestServer instance, given an app.

aiohttp_server(app, **kwargs)
z	127.0.0.1Nhostr6   r7   r   r6   r   r    c                   >#    [        XUS9nUR                  " SST0UD6I S h  vN   TR                  U5        U$  N7f)Nr   rQ   r#   )r   start_serverappend)r7   r   r6   r   serverrQ   serverss        r&   goaiohttp_server.<locals>.go3  sF      C6!!6t6v666v 	7s   "?=?c                     >#    T (       a0  T R                  5       R                  5       I S h  vN   T (       a  M/  g g  N7fr"   popcloser   s   r&   finalize aiohttp_server.<locals>.finalizeA  +     ++-%%''' g'   )><>>r    N)r   r/   r   r:   r   r   rS   rQ   r   r   r   s   `  @r&   aiohttp_serverr   +  sq      G
  "	

 
 sm	

 
 

 
 H( 	HJ's   AAc                 :    [         R                  " S[        SS9  U $ )Nz.Deprecated, use aiohttp_server fixture insteadr   r   r   )r   s    r&   test_serverr   H      MM8
 r1   c           	   #      ^ ^#    / mSS.S[         S[        [           S[        S[        4U U4S jjjnUv   S	U4S jjnT R                  U" 5       5        g7f)
zhFactory to create a RawTestServer instance, given a web handler.

aiohttp_raw_server(handler, **kwargs)
Nr5   r>   r6   r   r    c                   >#    [        XS9nUR                  " SST0UD6I S h  vN   TR                  U5        U$  N7f)Nr5   rQ   r#   )r   r   r   )r>   r6   r   r   rQ   r   s       r&   r   aiohttp_raw_server.<locals>.goZ  sD      w2!!6t6v666v 	7s   !><>c                     >#    T (       a0  T R                  5       R                  5       I S h  vN   T (       a  M/  g g  N7fr"   r   r   s   r&   r   $aiohttp_raw_server.<locals>.finalized  r   r   r   )r   r   r:   r   r   rS   r   s   `  @r&   aiohttp_raw_serverr   R  s_      G <@ +3C=KN	  H( 	HJ's   AAc                 :    [         R                  " S[        SS9  U $ )Nz2Deprecated, use aiohttp_raw_server fixture insteadr   r   r   )r   s    r&   raw_test_serverr   k  s!     MM<
 r1   c              #   .  ^ ^#    / m[         SS.S[        S[        [        [        [
        4      S[
        S[        [        [        4   4S jj5       n[         SS.S[        S[        [        [        [
        4      S[
        S[        [        S4   4S jj5       nSS.S[        [        [        4   S	[
        S[        [        [        [
        4      S[
        S[        [
        [
        4   4
UU 4S
 jjjnUv   SU4S jjnT R                  U" 5       5        g7f)zFactory to create a TestClient instance.

aiohttp_client(app, **kwargs)
aiohttp_client(server, **kwargs)
aiohttp_client(raw_server, **kwargs)
Nr   __paramr   r   r    c                   #    g 7fr"   r#   r   r   r   s      r&   r   aiohttp_client.<locals>.go  s
      ,/r)   c                   #    g 7fr"   r#   r   s      r&   r   r     s
      ),r)   r^   c                  >#    [        U [        5      (       a*  [        U [        [        45      (       d  U " T/UQ70 UD6n 0 nOU(       a   S5       e[        U [        5      (       a(  U=(       d    0 n[	        U 4ST0UD6n[        U4ST0UD6nO;[        U [        5      (       a  [        U 4ST0UD6nO[        S[        U 5      -  5      eUR                  5       I S h  vN   TR                  U5        U$  N7f)Nzargs should be emptyrQ   zUnknown argument type: %r)

isinstancer   r   r   r   r   r   typer   r   )r   r   r^   r   r   clientclientsrQ   s         r&   r   r     s      gx((k>22
 2
 d4T4V4GF3338g{++)/RMDdDmDF<T<V<F00=d=f=F84=HII!!###v 	$s   CC6C4C6c                     >#    T (       a0  T R                  5       R                  5       I S h  vN   T (       a  M/  g g  N7fr"   r   )r   s   r&   r    aiohttp_client.<locals>.finalize  r   r   r   )r   r   r   r   r/   r   r   r   r   r   r
   rS   )rQ   r   r   r   s   `  @r&   aiohttp_clientr   w  s2     G 37//  S#X// 	/
 
G[(	)/ /  37,,  S#X/, 	,
 
K%	&, , 37{N23  S#X/ 	
 
CH	 6 H( 	HJ's   DDc                 :    [         R                  " S[        SS9  U $ )Nz.Deprecated, use aiohttp_client fixture insteadr   r   r   )r   s    r&   test_clientr     r   r1   )F);r   
contextlibrd   rw   typingr   r   r   r   r   r   r	   r
   r   pytest
test_utilsr   r   r   r   r   r   r   r   r   webr   r   r   web_protocolr   r   ImportErrorr   r3   r<   rL   ri   fixturern   rp   contextmanagerr   r   r   r   r   AbstractEventLoopboolrQ   r   r:   r   r   r   r   r   r   r   r#   r1   r&   <module>r      s      
 
 
 	 	 	 3 2 )
,H ,&$H $'x '*6r 6 6
 C C
  . , , 8,@ 
2w8889


 
 g''(	
 
 x 9 9:   Xb#g%6 8BG;L   Xb#g.  
 (22 (x7N ( (8   (W66 (8DT;U ( (0   :(22 :(x7N :( :(z  i  Fs   H HH