Skip to content
Browse files

Minor cleanup to the select_for_update tests (as suggested by Alex Ga…


git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent c92e0e4 commit 6488f15a8efa6861361b6dbef02b890a997a75aa @jacobian jacobian committed
Showing with 4 additions and 8 deletions.
  1. +4 −8 tests/modeltests/select_for_update/
12 tests/modeltests/select_for_update/
@@ -11,17 +11,13 @@
from models import Person
+# Some tests require threading, which might not be available. So create a
+# skip-test decorator for those test functions.
import threading
- def requires_threading(func):
- return func
except ImportError:
- # Note we can't use dummy_threading here, as our tests will actually
- # block. We just have to skip the test completely.
- def requires_threading(func):
- @wraps(func)
- def wrapped(*args, **kw):
- raise unittest.SkipTest('threading required')
+ threading = None
+requires_threading = unittest.skipUnless(threading, 'requires threading')
class SelectForUpdateTests(TransactionTestCase):

0 comments on commit 6488f15

Please sign in to comment.
Something went wrong with that request. Please try again.