mirror of https://github.com/django/django.git
Fixed #30900 -- Skipped async-related tests on Windows using Python 3.8.0.
Refs https://bugs.python.org/issue38563.
This commit is contained in:
parent
fa5f3291e7
commit
e83c300a33
|
@ -1,5 +1,6 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
|
from unittest import skipIf
|
||||||
|
|
||||||
from asgiref.sync import async_to_sync
|
from asgiref.sync import async_to_sync
|
||||||
from asgiref.testing import ApplicationCommunicator
|
from asgiref.testing import ApplicationCommunicator
|
||||||
|
@ -12,6 +13,7 @@ from django.test import SimpleTestCase, override_settings
|
||||||
from .urls import test_filename
|
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')
|
@override_settings(ROOT_URLCONF='asgi.urls')
|
||||||
class ASGITest(SimpleTestCase):
|
class ASGITest(SimpleTestCase):
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import sys
|
||||||
|
from unittest import skipIf
|
||||||
|
|
||||||
from asgiref.sync import async_to_sync
|
from asgiref.sync import async_to_sync
|
||||||
|
|
||||||
from django.core.exceptions import SynchronousOnlyOperation
|
from django.core.exceptions import SynchronousOnlyOperation
|
||||||
|
@ -7,6 +10,7 @@ from django.utils.asyncio import async_unsafe
|
||||||
from .models import SimpleModel
|
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):
|
class DatabaseConnectionTest(SimpleTestCase):
|
||||||
"""A database connection cannot be used in an async context."""
|
"""A database connection cannot be used in an async context."""
|
||||||
@async_to_sync
|
@async_to_sync
|
||||||
|
@ -15,6 +19,7 @@ class DatabaseConnectionTest(SimpleTestCase):
|
||||||
list(SimpleModel.objects.all())
|
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):
|
class AsyncUnsafeTest(SimpleTestCase):
|
||||||
"""
|
"""
|
||||||
async_unsafe decorator should work correctly and returns the correct
|
async_unsafe decorator should work correctly and returns the correct
|
||||||
|
|
Loading…
Reference in New Issue