관리-도구
편집 파일: fixtures.cpython-37.opt-1.pyc
B �M!V� � @ s d dl Z d dlZd dlmZmZmZ d dlZddlmZ ddl m Z ddlmZmZ ddl mZ ddlmZ dd lmZ d d lmZ ddlmZ dd lmZmZ ddl mZ e�� Ze�dg� e js�G dd� de�Z nd dl!m Z dd� Z"i Z#edd� �Z$ddd�Z%dS )� N)� create_engine�text�MetaData� )�configparser)�util)�string_types� text_type)�MigrationContext)�EnvironmentContext)� Operations)�contextmanager� )�SkipTest)�_get_dialect�eq_)�mockztest.cfgc @ s: e Zd ZdZdZdZdZdZd dd�Zdd� Z dd� Z dS ) �TestBase� Nc C s |st |��d S )N)�AssertionError)�self�val�msgr r �I/opt/alt/python37/lib/python3.7/site-packages/alembic/testing/fixtures.py�assert_+ s zTestBase.assert_c C s t | d�r| �� d S )N�setUp)�hasattrr )r r r r �setup/ s zTestBase.setupc C s t | d�r| �� d S )N�tearDown)r r )r r r r �teardown3 s zTestBase.teardown)N)�__name__� __module__�__qualname__Z __whitelist__Z__requires__Z__unsupported_on__Z__only_on__Z__skip_if__r r r r r r r r s r )r c s( g � � �fdd�} t dd| d���� fS )Nc s � � t| j�jd��� d S )N)�dialect)�append�str�compiler# )�sqlZmultiparamsZparams)�buf�enginer r �dump= s zcapture_db.<locals>.dumpz postgresql://r )ZstrategyZexecutor)r )r* r )r( r) r � capture_db: s r+ c + sh �� dd�rt�� }nt�� }��d|d�� tj� � �fdd�}tj� td|�� |V W d Q R X d S )NZbytes_ioFZsqlite)Zdialect_name� output_bufferc s |j f �� � | |�S )N)�update)�arg�opt)�conf�kwr r � configureR s z)capture_context_buffer.<locals>.configurer2 ) �pop�io�BytesIO�StringIOr- r r2 r Zpatch�object)r1 r( r2 r )r0 r1 r �capture_context_bufferE s r8 �defaultFc s� i }|r$t jstd��t|d�|d<