From: Mike Bayer Date: Mon, 1 Dec 2014 00:08:01 +0000 (-0500) Subject: - fix drop_foreign_key to include that this only works with SQLite X-Git-Tag: rel_0_7_1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a6b2862ad402d5daa8966382ca4e03f0ab25154;p=thirdparty%2Fsqlalchemy%2Falembic.git - fix drop_foreign_key to include that this only works with SQLite as stated --- diff --git a/tests/requirements.py b/tests/requirements.py index afacd00b..47d8bc7e 100644 --- a/tests/requirements.py +++ b/tests/requirements.py @@ -32,7 +32,15 @@ class DefaultRequirements(SuiteRequirements): @property def no_fk_names(self): - """foreign key constraints have no names in the DB""" + """foreign key constraints *never* have names in the DB""" + # TODO: add exclusion SQLAlchemy < 1.0 when + # https://bitbucket.org/zzzeek/sqlalchemy/issue/3261/sqlite-backend-ignores-names-on-reflected + # is fixed + return exclusions.only_on(['sqlite']) + + @property + def unnamed_constraints(self): + """constraints without names are supported.""" return exclusions.only_on(['sqlite']) @property diff --git a/tests/test_batch.py b/tests/test_batch.py index bce262cc..b71e003f 100644 --- a/tests/test_batch.py +++ b/tests/test_batch.py @@ -675,6 +675,7 @@ class BatchRoundTripTest(TestBase): {"id": 5, "x": 9} ]) + @config.requirements.unnamed_constraints def test_drop_foreign_key(self): bar = Table( 'bar', self.metadata,