Skip to content

Commit

Permalink
Minor cleanup to the select_for_update tests (as suggested by Alex Ga…
Browse files Browse the repository at this point in the history
…ynor).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16060 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Apr 20, 2011
1 parent c92e0e4 commit 6488f15
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/modeltests/select_for_update/tests.py
Expand Up @@ -11,17 +11,13 @@


from models import Person from models import Person


# Some tests require threading, which might not be available. So create a
# skip-test decorator for those test functions.
try: try:
import threading import threading
def requires_threading(func):
return func
except ImportError: except ImportError:
# Note we can't use dummy_threading here, as our tests will actually threading = None
# block. We just have to skip the test completely. requires_threading = unittest.skipUnless(threading, 'requires threading')
def requires_threading(func):
@wraps(func)
def wrapped(*args, **kw):
raise unittest.SkipTest('threading required')


class SelectForUpdateTests(TransactionTestCase): class SelectForUpdateTests(TransactionTestCase):


Expand Down

0 comments on commit 6488f15

Please sign in to comment.