U
    g
                     @   sj   d dl Z d dlZd dlZddlmZmZmZmZ dd Zdd Z	dd	 Z
ejjejd
kdddd ZdS )    N   )current_async_libraryAsyncLibraryNotFoundErrorcurrent_async_library_cvarthread_localc               	   C   sf   t t t  W 5 Q R X td} zt dks6tW 5 t|  X t t t  W 5 Q R X d S Nzgeneric-lib)pytestraisesr   r   r   setresetAssertionError)token r   ?/tmp/pip-unpacked-wheel-52ge_d0w/sniffio/_tests/test_sniffio.pytest_basics_cvar   s    
r   c               	   C   sf   t t t  W 5 Q R X tjd } t_zt dks:tW 5 | t_X t t t  W 5 Q R X d S r   )r   r	   r   r   r   namer   )Zold_namer   r   r   test_basics_tlocal   s    r   c               	      sn   dd l } tt t  W 5 Q R X g   fdd}| |   dgksNttt t  W 5 Q R X d S )Nr   c                      s*   t  dkstt  dkst d d S )NasyncioTr   r   appendr   Zranr   r   this_is_asyncio0   s    z%test_asyncio.<locals>.this_is_asyncioT)r   r   r	   r   r   runr   )r   r   r   r   r   test_asyncio(   s    r   )      zEcurio broken on 3.12 (https://github.com/python-trio/sniffio/pull/42))reasonc               	      sl   dd l } tt t  W 5 Q R X g   fdd}| |  dgksLttt t  W 5 Q R X d S )Nr   c                      s*   t  dkstt  dkst d d S )NcurioTr   r   r   r   r   this_is_curioJ   s    z!test_curio.<locals>.this_is_curioT)r   r   r	   r   r   r   r   )r   r   r   r   r   
test_curio=   s    
r   )ossysr    r   r   r   r   r   r   r   markZskipifversion_infor   r   r   r   r   <module>   s   