summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-04-24 13:49:09 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-04-24 13:49:09 -0400
commite73f735382371ac5c05a46f2a51fd10971270fe4 (patch)
treed2cf84d2223e103bfde643da755e4e7487c791de /lib/sqlalchemy/testing/util.py
parent0fc751e4abea999b5cc7ba8c3a87a7a84cd5aa8c (diff)
downloadsqlalchemy-e73f735382371ac5c05a46f2a51fd10971270fe4.tar.gz
- Fixed regression regarding the declarative ``__declare_first__``
and ``__declare_last__`` accessors where these would no longer be called on the superclass of the declarative base. fixes #3383
Diffstat (limited to 'lib/sqlalchemy/testing/util.py')
-rw-r--r--lib/sqlalchemy/testing/util.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py
index 1842e58a5..e9437948a 100644
--- a/lib/sqlalchemy/testing/util.py
+++ b/lib/sqlalchemy/testing/util.py
@@ -267,3 +267,14 @@ def drop_all_tables(engine, inspector, schema=None, include_names=None):
ForeignKeyConstraint(
[tb.c.x], [tb.c.y], name=fkc)
))
+
+
+def teardown_events(event_cls):
+ @decorator
+ def decorate(fn, *arg, **kw):
+ try:
+ return fn(*arg, **kw)
+ finally:
+ event_cls._clear()
+ return decorate
+