관리-도구
편집 파일: pytest_plugin.cpython-37.pyc
B �k�a�- � @ s d dl Z d dlZd dlZd dlmZ d dlmZmZmZmZm Z m Z mZ d dlZd dl mZmZ d dlmZ ddlmZmZmZmZmZmZmZmZ yd dlZW n ek r� dZY nX yd dlZW n ek r� dZY nX eeeef gee f Zdd � Z d d� Z!ej"dd � �Z#ej"dd� �Z$ej%dd� �Z&ej%d0dd��Z'dd� Z(dd� Z)dd� Z*ej"dd� �Z+ej"dd� �Z,ej"dd � �Zej"d!d"� �Z-ej"d#d$� �Z.ej"d%d&� �Z/ej"d'd(� �Z0ej"d)d*� �Z1ej"e j2e eddf d+�d,d-��Z3ej"d.d/� �Z4dS )1� N)�Callable)�Any� Awaitabler �Dict� Generator�Optional�Union)�PY_37�isasyncgenfunction)�Application� )�BaseTestServer� RawTestServer� TestClient� TestServer�loop_context�setup_test_loop�teardown_test_loop�unused_portc C s: | j ddddd� | j dddd d� | j d dddd� d S )Nz--aiohttp-fast� store_trueFz*run tests faster by disabling extra checks)�action�default�helpz--aiohttp-loop�store�pyloopz:run tests with specific loop: pyloop, uvloop, tokio or allz--aiohttp-enable-loop-debugzenable event loop debug mode)Z addoption)�parser� r �H/opt/alt/python37/lib64/python3.7/site-packages/aiohttp/pytest_plugin.py�pytest_addoption$ s r c sb | j � t� �rd�nt�� �r$d�ndS d�d| jkrH| jd7 _d�� ��fdd�}|| _ dS )zjSet up pytest fixture. Allow fixtures to be coroutines. Run coroutine fixtures in an event loop. TFN�request)r c sv |d }�r|d= d|j kr$td��|�d�� �rb�| |��� �fdd�}|�|� � ���� �S � ��| |��S d S )Nr �loopz^Asynchronous fixtures must depend on the 'loop' fixture or be used in tests depending from it.c s( y� � ��� �S tk r" Y nX d S )N)�run_until_complete� __anext__�StopAsyncIterationr )�_loop�genr r � finalizerd s z8pytest_fixture_setup.<locals>.wrapper.<locals>.finalizer)�fixturenames� ExceptionZgetfixturevalueZaddfinalizerr! r"