summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2019-10-24 10:43:05 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-10-24 10:43:37 +0200
commit06e3c6db869400fe5ca050eb1e00bcd4503a61f3 (patch)
treef2f619718175633bd466d0e40fa2b391ad4396e9
parent318d186d7ed443d4c09745c755d4d186f9ed86d5 (diff)
[3.0.x] Fixed #30900 -- Skipped async-related tests on Windows using Python 3.8.0.
Refs https://bugs.python.org/issue38563. Backport of e83c300a3312995d46315616f4361dfa110c741b from master
-rw-r--r--tests/asgi/tests.py2
-rw-r--r--tests/async/tests.py5
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/asgi/tests.py b/tests/asgi/tests.py
index 32520fae29..eee12b95ba 100644
--- a/tests/asgi/tests.py
+++ b/tests/asgi/tests.py
@@ -1,5 +1,6 @@
import asyncio
import sys
+from unittest import skipIf
from asgiref.sync import async_to_sync
from asgiref.testing import ApplicationCommunicator
@@ -12,6 +13,7 @@ from django.test import SimpleTestCase, override_settings
from .urls import test_filename
+@skipIf(sys.platform == 'win32' and (3, 8, 0) < sys.version_info < (3, 8, 1), 'https://bugs.python.org/issue38563')
@override_settings(ROOT_URLCONF='asgi.urls')
class ASGITest(SimpleTestCase):
diff --git a/tests/async/tests.py b/tests/async/tests.py
index 1e1cabc1c6..450a38018d 100644
--- a/tests/async/tests.py
+++ b/tests/async/tests.py
@@ -1,3 +1,6 @@
+import sys
+from unittest import skipIf
+
from asgiref.sync import async_to_sync
from django.core.exceptions import SynchronousOnlyOperation
@@ -7,6 +10,7 @@ from django.utils.asyncio import async_unsafe
from .models import SimpleModel
+@skipIf(sys.platform == 'win32' and (3, 8, 0) < sys.version_info < (3, 8, 1), 'https://bugs.python.org/issue38563')
class DatabaseConnectionTest(SimpleTestCase):
"""A database connection cannot be used in an async context."""
@async_to_sync
@@ -15,6 +19,7 @@ class DatabaseConnectionTest(SimpleTestCase):
list(SimpleModel.objects.all())
+@skipIf(sys.platform == 'win32' and (3, 8, 0) < sys.version_info < (3, 8, 1), 'https://bugs.python.org/issue38563')
class AsyncUnsafeTest(SimpleTestCase):
"""
async_unsafe decorator should work correctly and returns the correct