summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-05-03 07:38:56 (GMT)
committerGitHub <noreply@github.com>2021-05-03 07:38:56 (GMT)
commit37ebdf0a866457ce825d0ff6e498a10938895760 (patch)
tree9bf3e95892b07549868a13e891c1584d230f2fc8 /Lib/test/test_asyncio
parent99ad742ea913e421d012c1a623029eac31bdfe85 (diff)
downloadcpython-37ebdf0a866457ce825d0ff6e498a10938895760.zip
cpython-37ebdf0a866457ce825d0ff6e498a10938895760.tar.gz
cpython-37ebdf0a866457ce825d0ff6e498a10938895760.tar.bz2
bpo-44011: Fix asyncio tests without ssl module (GH-25840)
Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_ssl.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_ssl.py b/Lib/test/test_asyncio/test_ssl.py
index 38235c6..4dcd3a0 100644
--- a/Lib/test/test_asyncio/test_ssl.py
+++ b/Lib/test/test_asyncio/test_ssl.py
@@ -3,14 +3,18 @@ import asyncio.sslproto
import contextlib
import gc
import logging
-import os
import select
import socket
-import ssl
import tempfile
import threading
import time
import weakref
+import unittest
+
+try:
+ import ssl
+except ImportError:
+ ssl = None
from test import support
from test.test_asyncio import utils as test_utils
@@ -54,6 +58,7 @@ class MyBaseProto(asyncio.Protocol):
self.done.set_result(None)
+@unittest.skipIf(ssl is None, 'No ssl module')
class TestSSL(test_utils.TestCase):
PAYLOAD_SIZE = 1024 * 100