mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Closes #22784: fix test_asyncio when the ssl module isn't available
This commit is contained in:
parent
b9b389efed
commit
50219fcd23
1 changed files with 9 additions and 8 deletions
|
@ -606,14 +606,15 @@ class EventLoopTestsMixin:
|
|||
self.assertGreater(pr.nbytes, 0)
|
||||
tr.close()
|
||||
|
||||
def _dummy_ssl_create_context(self, purpose=ssl.Purpose.SERVER_AUTH, *,
|
||||
cafile=None, capath=None, cadata=None):
|
||||
"""
|
||||
A ssl.create_default_context() replacement that doesn't enable
|
||||
cert validation.
|
||||
"""
|
||||
self.assertEqual(purpose, ssl.Purpose.SERVER_AUTH)
|
||||
return test_utils.dummy_ssl_context()
|
||||
if ssl:
|
||||
def _dummy_ssl_create_context(self, purpose=ssl.Purpose.SERVER_AUTH, *,
|
||||
cafile=None, capath=None, cadata=None):
|
||||
"""
|
||||
A ssl.create_default_context() replacement that doesn't enable
|
||||
cert validation.
|
||||
"""
|
||||
self.assertEqual(purpose, ssl.Purpose.SERVER_AUTH)
|
||||
return test_utils.dummy_ssl_context()
|
||||
|
||||
def _test_create_ssl_connection(self, httpd, create_connection,
|
||||
check_sockname=True):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue