summaryrefslogtreecommitdiff
path: root/test/testlib/testing.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-01-09 22:54:51 +0000
committerJason Kirtland <jek@discorporate.us>2008-01-09 22:54:51 +0000
commit84576e3258ea05b044f90463e8a59541661d5931 (patch)
treebb270f23d8f9b53a58e2f1523733d714d2f45fde /test/testlib/testing.py
parent046ec98a0bb5065b931911aa3e3a3ec6fe9f8507 (diff)
downloadsqlalchemy-84576e3258ea05b044f90463e8a59541661d5931.tar.gz
test suite deprecation rampage
Diffstat (limited to 'test/testlib/testing.py')
-rw-r--r--test/testlib/testing.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/testlib/testing.py b/test/testlib/testing.py
index 63b1cba70..35701377a 100644
--- a/test/testlib/testing.py
+++ b/test/testlib/testing.py
@@ -208,6 +208,19 @@ def rowset(results):
return set([tuple(row) for row in results])
+
+def squelch_deprecation(callable_):
+ _set_deprecation(callable_, False)
+
+def enable_deprecation(callable_):
+ _set_deprecation(callable_, True)
+
+def _set_deprecation(callable_, state):
+ if hasattr(callable_, 'im_func'):
+ callable_ = callable_.im_func
+ assert hasattr(callable_, 'warn'), 'Callable is not deprecated'
+ setattr(callable_, 'warn', state)
+
class TestData(object):
"""Tracks SQL expressions as they are executed via an instrumented ExecutionContext."""