diff options
author | Jason Kirtland <jek@discorporate.us> | 2008-01-28 19:58:39 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2008-01-28 19:58:39 +0000 |
commit | b5dd96590a808ed022780f9932f0a4380d494124 (patch) | |
tree | 79df2db4f17e50fd2ee5e08b43b26b2e309d825a /test/testlib/testing.py | |
parent | 7ed5faff265adbda5b4ceae333b09df97e316108 (diff) | |
download | sqlalchemy-b5dd96590a808ed022780f9932f0a4380d494124.tar.gz |
- Added a simple @future test marker.
Diffstat (limited to 'test/testlib/testing.py')
-rw-r--r-- | test/testlib/testing.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/testlib/testing.py b/test/testlib/testing.py index bb3d2c3a5..32e5e9b4a 100644 --- a/test/testlib/testing.py +++ b/test/testlib/testing.py @@ -57,6 +57,25 @@ def fails_if(callable_): return decorate +def future(fn): + """Mark a test as expected to unconditionally fail. + + Takes no arguments, omit parens when using as a decorator. + """ + + fn_name = fn.__name__ + def decorated(*args, **kw): + try: + fn(*args, **kw) + except Exception, ex: + print ("Future test '%s' failed as expected: %s " % ( + fn_name, str(ex))) + return True + else: + raise AssertionError( + "Unexpected success for future test '%s'" % fn_name) + return _function_named(decorated, fn_name) + def fails_on(*dbs): """Mark a test as expected to fail on one or more database implementations. |