diff options
author | Tim Graham <timograham@gmail.com> | 2015-01-28 09:55:52 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-01-28 10:23:25 -0500 |
commit | 18f3e79b13947de0bda7c985916d5a04e28936dc (patch) | |
tree | e944eb683d966d8523ffebd99b5b9fabd5591474 /tests/select_for_update | |
parent | cd91486213b6c3d9e0a2e6e329fffc8aff40f183 (diff) | |
download | django-18f3e79b13947de0bda7c985916d5a04e28936dc.tar.gz |
Removed threading fallback imports.
Django imports threading in many other places without fallback.
Diffstat (limited to 'tests/select_for_update')
-rw-r--r-- | tests/select_for_update/tests.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/tests/select_for_update/tests.py b/tests/select_for_update/tests.py index d3f71ab65c..abd7bd2ed4 100644 --- a/tests/select_for_update/tests.py +++ b/tests/select_for_update/tests.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals +import threading import time -import unittest from django.conf import settings from django.db import transaction, connection, router @@ -15,14 +15,6 @@ from multiple_database.routers import TestRouter from .models import Person -# Some tests require threading, which might not be available. So create a -# skip-test decorator for those test functions. -try: - import threading -except ImportError: - threading = None -requires_threading = unittest.skipUnless(threading, 'requires threading') - # We need to set settings.DEBUG to True so we can capture the output SQL # to examine. @@ -92,7 +84,6 @@ class SelectForUpdateTests(TransactionTestCase): list(Person.objects.all().select_for_update(nowait=True)) self.assertTrue(self.has_for_update_sql(connection, nowait=True)) - @requires_threading @skipUnlessDBFeature('has_select_for_update_nowait') def test_nowait_raises_error_on_block(self): """ @@ -173,7 +164,6 @@ class SelectForUpdateTests(TransactionTestCase): # database connection. Close it without waiting for the GC. connection.close() - @requires_threading @skipUnlessDBFeature('has_select_for_update') @skipUnlessDBFeature('supports_transactions') def test_block(self): @@ -223,7 +213,6 @@ class SelectForUpdateTests(TransactionTestCase): p = Person.objects.get(pk=self.person.pk) self.assertEqual('Fred', p.name) - @requires_threading @skipUnlessDBFeature('has_select_for_update') def test_raw_lock_not_available(self): """ |