summaryrefslogtreecommitdiff
path: root/test/testlib/testing.py
diff options
context:
space:
mode:
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."""