o
    4@Hh                     @  sV   U d dl mZ d dlZddlmZ edZded< dd	d
ZdddZ	dddZ
dS )    )annotationsN   )_coretrio_testing_contextvarzcontextvars.ContextVar[str]returnNonec               	     sv   t d g  d fdd} t 4 I d H }||  W d   I d H  n1 I d H s-w   Y   dgks9J d S )Nmainr   r   c                       t  }  |  d S Nr   getappendvaluerecord \/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/trio/_tests/test_contextvars.pychild      z'test_contextvars_default.<locals>.childr   r   )r   setr   open_nursery
start_soon)r   nurseryr   r   r   test_contextvars_default   s   
(r   c               	     s   t d g  d fdd} t 4 I d H }||  W d   I d H  n1 I d H s-w   Y  t  } dgks=J |dksCJ d S )Nr   r   r   c                    s"   t d t  }  |  d S )Nr   )r   r   r   r   r   r   r   r   r      s   
z#test_contextvars_set.<locals>.childr   r   )r   r   r   r   r   r   )r   r   r   r   r   r   test_contextvars_set   s   
(r   c               	     s   t d t } t d g  d fdd}t 4 I d H }| |j| || W d   I d H  n1 I d H s=w   Y  t  }t ddhksPJ |dksVJ d S )Nr   second_mainr   r   c                    r	   r
   r   r   r   r   r   r   /   r   z$test_contextvars_copy.<locals>.childr   )	r   r   contextvarscopy_contextr   r   runr   r   )contextr   r   r   r   r   r   test_contextvars_copy)   s   

(r"   r   )
__future__r   r    r   
ContextVarr   __annotations__r   r   r"   r   r   r   r   <module>   s    

