mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Corrected the skipIfDBFeature and skipUnlessDBFeature decorators to actually *run* the tests they decorate. Thanks to Alex for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14243 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -576,13 +576,16 @@ class TestCase(TransactionTestCase):
|
||||
connection.close()
|
||||
|
||||
def _deferredSkip(condition, reason):
|
||||
def decorator(test_item):
|
||||
if not (isinstance(test_item, type) and issubclass(test_item, TestCase)):
|
||||
@wraps(test_item)
|
||||
def decorator(test_func):
|
||||
if not (isinstance(test_func, type) and issubclass(test_func, TestCase)):
|
||||
@wraps(test_func)
|
||||
def skip_wrapper(*args, **kwargs):
|
||||
if condition():
|
||||
raise unittest.SkipTest(reason)
|
||||
return test_func(*args, **kwargs)
|
||||
test_item = skip_wrapper
|
||||
else:
|
||||
test_item = test_func
|
||||
test_item.__unittest_skip_why__ = reason
|
||||
return test_item
|
||||
return decorator
|
||||
|
||||
Reference in New Issue
Block a user