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 | |
| parent | cd91486213b6c3d9e0a2e6e329fffc8aff40f183 (diff) | |
Removed threading fallback imports.
Django imports threading in many other places without fallback.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/file_storage/tests.py | 6 | ||||
| -rw-r--r-- | tests/select_for_update/tests.py | 13 | ||||
| -rw-r--r-- | tests/transactions/tests.py | 5 |
3 files changed, 3 insertions, 21 deletions
diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index 4edee3cb80..2718f07cad 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -6,16 +6,12 @@ import os import shutil import sys import tempfile +import threading import time import unittest import warnings from datetime import datetime, timedelta -try: - import threading -except ImportError: - import dummy_threading as threading - from django.core.cache import cache from django.core.exceptions import SuspiciousOperation, SuspiciousFileOperation from django.core.files.base import File, ContentFile 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): """ diff --git a/tests/transactions/tests.py b/tests/transactions/tests.py index 005df0ba91..bf4735e0d2 100644 --- a/tests/transactions/tests.py +++ b/tests/transactions/tests.py @@ -1,10 +1,7 @@ from __future__ import unicode_literals import sys -try: - import threading -except ImportError: - threading = None +import threading import time from unittest import skipIf, skipUnless |
