diff options
author | Michael Trier <mtrier@gmail.com> | 2008-12-12 03:41:05 +0000 |
---|---|---|
committer | Michael Trier <mtrier@gmail.com> | 2008-12-12 03:41:05 +0000 |
commit | 1d90146210b0919294a99468a916d4084fc14c7d (patch) | |
tree | 75bf422e326289f225adc399675d9a316486878a /test/testlib/testing.py | |
parent | aaac4520d3a4d1b2b73403bedaeb67d9cf26409c (diff) | |
download | sqlalchemy-1d90146210b0919294a99468a916d4084fc14c7d.tar.gz |
Modified fails_on testing decorator to take a reason for the failure.
This should assist with helping to document the reasons for testing failures.
Currently unspecified failures are defaulted to 'FIXME: unknown'.
Diffstat (limited to 'test/testlib/testing.py')
-rw-r--r-- | test/testlib/testing.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/testlib/testing.py b/test/testlib/testing.py index ed7669be9..650fa86a7 100644 --- a/test/testlib/testing.py +++ b/test/testlib/testing.py @@ -91,8 +91,9 @@ def future(fn): "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. +def fails_on(dbs, reason): + """Mark a test as expected to fail on the specified database + implementation. Unlike ``crashes``, tests marked as ``fails_on`` will be run for the named databases. The test is expected to fail and the unit test @@ -103,7 +104,7 @@ def fails_on(*dbs): def decorate(fn): fn_name = fn.__name__ def maybe(*args, **kw): - if config.db.name not in dbs: + if config.db.name != dbs: return fn(*args, **kw) else: try: @@ -111,7 +112,7 @@ def fails_on(*dbs): except Exception, ex: print ("'%s' failed as expected on DB implementation " "'%s': %s" % ( - fn_name, config.db.name, str(ex))) + fn_name, config.db.name, reason)) return True else: raise AssertionError( |