
     fQ                        d dl mZ d dlmZmZ d dlmZmZ ddlm	Z	 ddl
mZmZ erd dlmZmZ d dlmZ  ed	          Z ed
          ZddZdS )    )annotations)partialwraps)TYPE_CHECKINGTypeVar   )_core)Clock
Instrument)	AwaitableCallable)	ParamSpecArgsTRetTfn Callable[ArgsT, Awaitable[RetT]]returnCallable[ArgsT, RetT]c                >     t                     d fd            }|S )	aN  Converts an async test function to be synchronous, running via Trio.

    Usage::

        @trio_test
        async def test_whatever():
            await ...

    If a pytest fixture is passed in that subclasses the :class:`~trio.abc.Clock` or
    :class:`~trio.abc.Instrument` ABCs, then those are passed to :meth:`trio.run()`.
    args
ArgsT.argskwargsArgsT.kwargsr   r   c                 *   d}d |                                 D             }|sd }n+t          |          dk    r	|d         }nt          d          d |                                 D             }t          j        t          g| R i |||          S )NTc                <    g | ]}t          |t                    |S  )
isinstancer
   ).0cs     Z/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/trio/testing/_trio_test.py
<listcomp>z.trio_test.<locals>.wrapper.<locals>.<listcomp>$   s'    EEE
1e0D0DE!EEE       r   z too many clocks spoil the broth!c                <    g | ]}t          |t                    |S r   )r   r   )r   is     r    r!   z.trio_test.<locals>.wrapper.<locals>.<listcomp>+   s'    OOOQZ:5N5NOqOOOr"   )clockinstruments)valueslen
ValueErrorr	   runr   )r   r   __tracebackhide__clocksr&   r'   r   s         r    wrapperztrio_test.<locals>.wrapper!   s     EEV]]__EEE 	AEE[[A1IEE?@@@OO&--//OOOyB((((((;
 
 
 	
r"   )r   r   r   r   r   r   )r   )r   r.   s   ` r    	trio_testr/      s:     2YY
 
 
 
 
 Y
 Nr"   N)r   r   r   r   )
__future__r   	functoolsr   r   typingr   r    r	   abcr
   r   collections.abcr   r   typing_extensionsr   r   r   r/   r   r"   r    <module>r7      s    " " " " " " $ $ $ $ $ $ $ $ ) ) ) ) ) ) ) )       # # # # # # # # 33333333++++++IgE wv     r"   