diff options
author | Jason Kirtland <jek@discorporate.us> | 2008-01-09 22:54:51 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2008-01-09 22:54:51 +0000 |
commit | 84576e3258ea05b044f90463e8a59541661d5931 (patch) | |
tree | bb270f23d8f9b53a58e2f1523733d714d2f45fde /test/testlib/testing.py | |
parent | 046ec98a0bb5065b931911aa3e3a3ec6fe9f8507 (diff) | |
download | sqlalchemy-84576e3258ea05b044f90463e8a59541661d5931.tar.gz |
test suite deprecation rampage
Diffstat (limited to 'test/testlib/testing.py')
-rw-r--r-- | test/testlib/testing.py | 13 |
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.""" |