Edit File: test_dialect.cpython-37.pyc
B ��4]� � @ s� d dl mZ d dl mZ d dl mZ d dl mZ d dl mZ d dlmZ d dlmZ d dlm Z d d l m Z d dl mZ d dl mZ d d l m Z d dl mZ d dlmZ G dd� dej�ZG dd� dej�ZG dd� dej�ZdS )� )� assert_raises)�config)�eq_)�fixtures)�provide_metadata)�requirements)�Column)�Table� )�exc)�Integer)�literal_column)�select)�String)�compatc @ s: e Zd ZdZdZdZedd� �Zej dd� �Z dd � Zd S )� ExceptionTestz�Test basic exception wrapping. DBAPIs vary a lot in exception behavior so to actually anticipate specific exceptions from real round trips, we need to be conservative. �eachTc C s( t d|tdtddd�tdtd��� d S )N� manual_pk�idTF)�primary_key� autoincrement�data�2 )r r r r )�cls�metadata� r �X/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/testing/suite/test_dialect.py� define_tables s zExceptionTest.define_tablesc C sd t j�� �P}|�� }|�| jj�� ddd�� tt j |j| jj�� ddd�� |�� W d Q R X d S )N� �d1)r r )r �db�connect�begin�execute�tablesr �insertr r ZIntegrityError�rollback)�self�conn�transr r r �test_integrity_error( s z"ExceptionTest.test_integrity_errorc C s� t j�� ��}y |�ttd�g�� ds*t�W nB tjk rn } z"t |�}t |j �t |�ks^t�W d d }~X Y nX tjr�t |t �s�t�nt |t �s�t�W d Q R X d S )Nu méilF)r r r! r# r r �AssertionErrorr Z DBAPIError�str�origr Zpy2k� isinstance)r'