Removed threading fallback imports.

Django imports threading in many other places without fallback.
This commit is contained in:
Tim Graham 2015-01-28 09:55:52 -05:00
parent cd91486213
commit 18f3e79b13
6 changed files with 6 additions and 33 deletions

View file

@ -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):
"""