summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/engines.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-04-22 14:14:11 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-04-22 14:14:11 -0400
commit39978060b0d81bd470aade97e608c189b6958dfa (patch)
tree07fa0fc99fba3ec3435a78647375b52df8b39811 /lib/sqlalchemy/testing/engines.py
parentf704b7265a634be70f0255adfb2a084b7384b727 (diff)
downloadsqlalchemy-39978060b0d81bd470aade97e608c189b6958dfa.tar.gz
- repair a regression caused by #3282, where we no longer were
applying any topological sort to tables on SQLite. See the changelog for details, but we now continue to sort tables for SQLite on DROP, prohibit the sort from considering alter, and only warn if we encounter an unresolvable cycle, in which case, then we forego the ordering. use_alter as always is used to break such a cycle. fixes #3378
Diffstat (limited to 'lib/sqlalchemy/testing/engines.py')
-rw-r--r--lib/sqlalchemy/testing/engines.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/sqlalchemy/testing/engines.py b/lib/sqlalchemy/testing/engines.py
index 3a8303546..8bd1becbf 100644
--- a/lib/sqlalchemy/testing/engines.py
+++ b/lib/sqlalchemy/testing/engines.py
@@ -98,7 +98,14 @@ def drop_all_tables(metadata, bind):
testing_reaper.close_all()
if hasattr(bind, 'close'):
bind.close()
- metadata.drop_all(bind)
+
+ if not config.db.dialect.supports_alter:
+ from . import assertions
+ with assertions.expect_warnings(
+ "Can't sort tables", assert_=False):
+ metadata.drop_all(bind)
+ else:
+ metadata.drop_all(bind)
@decorator