관리-도구
편집 파일: assertions.cpython-38.pyc
U -?�f�z � @ s� d dl mZ d dlmZ d dlZd dlmZ d dlmZ d dlZd dl Z d dl Z ddlmZ ddlm Z dd lmZ dd lmZ ddlmZ ddlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ dd� Z ej!dd� �Z"dd� Z#dd� Z$dd � Z%d!d"� Z&d#d$� Z'da(da)da*dod'd(�Z+ej!dpd)d*��Z,d+d,� Z-d-d.� Z.d/d0� Z/dqd1d2�Z0drd3d4�Z1dsd5d6�Z2dtd7d8�Z3dud9d:�Z4dvd;d<�Z5dwd=d>�Z6dxd?d@�Z7dydAdB�Z8dzdCdD�Z9d{dEdF�Z:e:Z;d|dGdH�Z<d}dIdJ�Z=e=Z>d~dKdL�Z?ddMdN�Z@dOdP� ZAdQdR� ZBdSdT� ZCdUdV� ZDdWdX� ZEdYdZ� ZFd[d\� ZGd�d]d^�ZHG d_d`� d`�ZIej!d�dadb��ZJd�dcdd�ZKd�dedf�ZLG dgdh� dh�ZMG didj� dj�ZNG dkdl� dl�ZOG dmdn� dn�ZPdS )�� )�annotations)�defaultdictN)�copy)�filterfalse� )� assertsql)�config)�engines)�mock)�db_spec)�fail� )�exc)�schema)�sql)�types)�util)�default)�url)�LABEL_STYLE_TABLENAME_PLUS_COL�� decoratorc O s t tj| f|�S )a� Context manager which expects one or more warnings. With no arguments, squelches all SAWarning emitted via sqlalchemy.util.warn and sqlalchemy.util.warn_limited. Otherwise pass string expressions that will match selected warnings via regex; all non-matching warnings are sent through. The expect version **asserts** that the warnings were in fact seen. Note that the test suite sets SAWarning warnings to raise exceptions. )�_expect_warnings_sqla_only�sa_excZ SAWarning��messages�kw� r �M/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/testing/assertions.py�expect_warnings% s r c o sD t | �}t| t�r$|tj�s$dV nt||�� dV W 5 Q R X dS )z�Context manager which expects one or more warnings on specific dialects. The expect version **asserts** that the warnings were in fact seen. N)r � isinstance�strr �_currentr )�dbr r �specr r r �expect_warnings_on5 s r% c s t � fdd��}|S )z�Decorator form of expect_warnings(). Note that emits_warning does **not** assert that the warnings were in fact seen. c s0 t � ddi�� | ||�W 5 Q R � S Q R X d S �N�assert_F)r ��fn�argsr �r r r �decorateN s zemits_warning.<locals>.decorater �r r, r r+ r � emits_warningF s r. c O s t tj| f|�S �N)r r ZSADeprecationWarningr r r r �expect_deprecatedV s ��r0 c O s t tj| f|�S r/ )r r ZBase20DeprecationWarningr r r r �expect_deprecated_20\ s ��r1 c s t � �fdd��}|S )aV Mark a test as emitting a warning on a specific dialect. With no arguments, squelches all SAWarning failures. Or pass one or more strings; these will be matched to the root of the warning description by warnings.filterwarnings(). Note that emits_warning_on does **not** assert that the warnings were in fact seen. c s6 t � f��ddi�� | ||�W 5 Q R � S Q R X d S r&