관리-도구
편집 파일: test_environment.cpython-38.pyc
U 0?�fe. � @ s� d dl Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lm Z dd lm Z ddlmZ ddlm Z G d d� de �ZdS )� N� )�MigrationContext)� assert_raises)�config)�eq_)�is_)�is_false)�is_not_)�is_true)�ne_)�TestBasec @ s� e Zd ZdZdZdd� Zdd� Zdd� Zd d � Zdd� Z d d� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zejjdd � �Zejjd!d"� �Zd#d$� Zd%d&� Zd'd(� ZdS ))�MigrationTransactionTestTNc C s\ t j�� | _}|�dd�rFtj|j|d�| _t � � | j_| jj_ntj||d�| _| jS )N�as_sqlF)�dialect�opts)� connectionr ) r �db�connect�conn�getr � configurer �context�io�StringIO� output_buffer�impl)�selfr r � r �T/opt/hc_python/lib/python3.8/site-packages/alembic/testing/suite/test_environment.py�_fixture s �� �z!MigrationTransactionTest._fixturec C s | j r| j �� d S )N)r �close)r r r r �teardown_method$ s z(MigrationTransactionTest.teardown_methodc C sR | � ddd��}t| j�� � |jdd�}t| j�� � |�� t| j�� � d S �NT��transaction_per_migration�transactional_ddl�Z_per_migration)r r r �in_transaction�begin_transactionr �rollback�r r �proxyr r r �test_proxy_transaction_rollback( s �z8MigrationTransactionTest.test_proxy_transaction_rollbackc C sD | � ddd��}|jdd�}t| j�� � |�� t| j�� � d S r"