Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_contextlib_async.cpython-311.pyc |
�
�Ke0_ � �z � d dl Z d dlmZmZmZmZmZmZ d dlZd dl m
Z
d dlZd dlZd dl
mZ e
j d�� � d� Zd� Z G d � d
ej � � Z G d� dej � � Z G d
� dej � � Z G d� deej � � Z G d� dej � � Zedk r ej � � dS dS )� N)�asynccontextmanager�AbstractAsyncContextManager�AsyncExitStack�nullcontext�aclosing�contextmanager)�support)�TestBaseExitStackT)�modulec �F � � t j � � � � fd�� � }|S )z5Decorator to turn an async function into a test case.c �@ �� �| i |��}t j |� � d S �N)�asyncio�run)�args�kwargs�coro�funcs ��D/usr/local/apps/python3/lib/python3.11/test/test_contextlib_async.py�wrapperz_async_test.<locals>.wrapper s- �� ��t�T�$�V�$�$����D������ )� functools�wraps)r r s ` r �_async_testr s8 �� ��_�T���� � � � ��� �Nr c �. � t j d � � d S r )r �set_event_loop_policy� r r �tearDownModuler s � ��!�$�'�'�'�'�'r c �F � e Zd Zed� � � Zed� � � Zd� Zd� ZdS )�TestAbstractAsyncContextManagerc � �& K � G d� dt � � } |� � }| � |� � � � d {V ��|� � |4 �d {V ��}| � ||� � d d d � � �d {V �� d S # 1 �d {V ��swxY w Y d S )Nc � � � e Zd Z� fd�Z� xZS )�@TestAbstractAsyncContextManager.test_enter.<locals>.DefaultEnterc � �D �K � t � � j |� � d {V �� d S r ��super� __aexit__��selfr � __class__s �r r'