log database name when running tests; firebug does not support DROP CONSTRAINT CASCADE

This commit is contained in:
iElectric 2010-07-08 01:58:02 +02:00
parent 960bce7de1
commit c0e8518d2f
2 changed files with 6 additions and 7 deletions

View File

@ -118,20 +118,15 @@ class TestConstraint(CommonTestConstraint):
"""Multicolumn PK constraints can be defined, created, and dropped"""
self._define_pk(self.table.c.id, self.table.c.fkey)
@fixture.usedb()
@fixture.usedb(not_supported=['firebird'])
def test_drop_cascade(self):
"""Drop constraint cascaded"""
pk = PrimaryKeyConstraint('fkey', table=self.table, name="id_pkey")
pk.create()
self.refresh_table()
# Drop the PK constraint forcing cascade
try:
pk.drop(cascade=True)
except NotSupportedError:
if self.engine.name == 'firebird':
pass
pk.drop(cascade=True)
# TODO: add real assertion if it was added

View File

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import os
import logging
from decorator import decorator
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
log = logging.getLogger(__name__)
@Memoize
def readurls():
"""read URLs from config file return a list"""
@ -74,6 +77,7 @@ def usedb(supported=None, not_supported=None):
@decorator
def dec(f, self, *a, **kw):
for url in my_urls:
log.debug("Running test with engine %s", url)
try:
self._setup(url)
f(self, *a, **kw)