log database name when running tests; firebug does not support DROP CONSTRAINT CASCADE
This commit is contained in:
parent
960bce7de1
commit
c0e8518d2f
@ -118,20 +118,15 @@ class TestConstraint(CommonTestConstraint):
|
|||||||
"""Multicolumn PK constraints can be defined, created, and dropped"""
|
"""Multicolumn PK constraints can be defined, created, and dropped"""
|
||||||
self._define_pk(self.table.c.id, self.table.c.fkey)
|
self._define_pk(self.table.c.id, self.table.c.fkey)
|
||||||
|
|
||||||
@fixture.usedb()
|
@fixture.usedb(not_supported=['firebird'])
|
||||||
def test_drop_cascade(self):
|
def test_drop_cascade(self):
|
||||||
"""Drop constraint cascaded"""
|
"""Drop constraint cascaded"""
|
||||||
|
|
||||||
pk = PrimaryKeyConstraint('fkey', table=self.table, name="id_pkey")
|
pk = PrimaryKeyConstraint('fkey', table=self.table, name="id_pkey")
|
||||||
pk.create()
|
pk.create()
|
||||||
self.refresh_table()
|
self.refresh_table()
|
||||||
|
|
||||||
# Drop the PK constraint forcing cascade
|
# Drop the PK constraint forcing cascade
|
||||||
try:
|
pk.drop(cascade=True)
|
||||||
pk.drop(cascade=True)
|
|
||||||
except NotSupportedError:
|
|
||||||
if self.engine.name == 'firebird':
|
|
||||||
pass
|
|
||||||
|
|
||||||
# TODO: add real assertion if it was added
|
# TODO: add real assertion if it was added
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import logging
|
||||||
from decorator import decorator
|
from decorator import decorator
|
||||||
|
|
||||||
from sqlalchemy import create_engine, Table, MetaData
|
from sqlalchemy import create_engine, Table, MetaData
|
||||||
@ -16,6 +17,8 @@ from migrate.tests.fixture.base import Base
|
|||||||
from migrate.tests.fixture.pathed import Pathed
|
from migrate.tests.fixture.pathed import Pathed
|
||||||
|
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@Memoize
|
@Memoize
|
||||||
def readurls():
|
def readurls():
|
||||||
"""read URLs from config file return a list"""
|
"""read URLs from config file return a list"""
|
||||||
@ -74,6 +77,7 @@ def usedb(supported=None, not_supported=None):
|
|||||||
@decorator
|
@decorator
|
||||||
def dec(f, self, *a, **kw):
|
def dec(f, self, *a, **kw):
|
||||||
for url in my_urls:
|
for url in my_urls:
|
||||||
|
log.debug("Running test with engine %s", url)
|
||||||
try:
|
try:
|
||||||
self._setup(url)
|
self._setup(url)
|
||||||
f(self, *a, **kw)
|
f(self, *a, **kw)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user