
    ?_                     P    d dl Z d dlZd dlmZ d dlmZ d Z G d de          ZdS )    N)TestCase)maybe_awaitc                       fd}|S )Nc                  `    t          j                    }|                     | i |          S )N)asyncioget_event_looprun_until_complete)argskwargsloopfns      :lib/python3.11/site-packages/aioitertools/tests/helpers.pywrappedzasync_test.<locals>.wrapped   s4    %''&&rr4':6':':;;;     )r   r   s   ` r   
async_testr      s#    < < < < < Nr   c                   f    e Zd Zed             Zed             Zed             Zed             ZdS )HelpersTestc                 \   K   |                      t          d           d {V d           d S )N*   assertEqualr   )selfs    r   test_maybe_awaitzHelpersTest.test_maybe_await   s:      {2......33333r   c                 r   K   d }|                      t           |                       d {V d           d S )Nc                  >   K   t          j        d           d {V  dS N-C6?r   r   sleepr   r   r   	forty_twoz9HelpersTest.test_maybe_await_async_def.<locals>.forty_two   s-      -'''''''''2r   r   r   r   r!   s     r   test_maybe_await_async_defz&HelpersTest.test_maybe_await_async_def   sS      	 	 	 	{99;;77777777<<<<<r   c                    K   t           j        d             }|                     t           |                       d {V d           d S )Nc               3   >   K   t          j        d          E d {V  dS r   r   r   r   r   r!   z9HelpersTest.test_maybe_await_coroutine.<locals>.forty_two%   s-      }V,,,,,,,,,2r   r   )r   	coroutiner   r   r"   s     r   test_maybe_await_coroutinez&HelpersTest.test_maybe_await_coroutine#   sa      			 	 
		 	{99;;77777777<<<<<r   c           	         K   d }|                      t           t          j        |d          d                     d {V d           d S )Nc                 D   K   t          j        d           d {V  | |z  S )Nr   r   )abs     r   multiplyz6HelpersTest.test_maybe_await_partial.<locals>.multiply.   s1      -'''''''''q5Lr         r   )r   r   	functoolspartial)r   r,   s     r   test_maybe_await_partialz$HelpersTest.test_maybe_await_partial,   se      	 	 	 	{+I9+<Xq+I+I!+L+LMMMMMMMMrRRRRRr   N)__name__
__module____qualname__r   r   r#   r'   r1   r   r   r   r   r      s         4 4 Z4 = = Z= = = Z= S S ZS S Sr   r   )r   r/   unittestr   aioitertools.helpersr   r   r   r   r   r   <module>r7      s               , , , , , ,  S S S S S( S S S S Sr   