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:
@@ -1,9 +1,23 @@
|
||||
import sys
|
||||
|
||||
from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
|
||||
|
||||
|
||||
if sys.version_info >= (2, 5):
|
||||
from python_25 import AssertNumQueriesTests
|
||||
|
||||
|
||||
class SkippingTestCase(TestCase):
|
||||
def test_skip_unless_db_feature(self):
|
||||
"A test that might be skipped is actually called."
|
||||
# Total hack, but it works, just want an attribute that's always true.
|
||||
@skipUnlessDBFeature("__class__")
|
||||
def test_func():
|
||||
raise ValueError
|
||||
|
||||
self.assertRaises(ValueError, test_func)
|
||||
|
||||
|
||||
__test__ = {"API_TEST": r"""
|
||||
# Some checks of the doctest output normalizer.
|
||||
# Standard doctests do fairly
|
||||
|
||||
Reference in New Issue
Block a user