mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21452)
This commit is contained in:
parent
da4e09fff6
commit
604bba1f8f
6 changed files with 62 additions and 54 deletions
|
|
@ -8,9 +8,9 @@ import threading
|
|||
import unittest
|
||||
import hashlib
|
||||
|
||||
from test import support
|
||||
from test.support import hashlib_helper
|
||||
from test.support import threading_helper
|
||||
from test.support import warnings_helper
|
||||
|
||||
try:
|
||||
import ssl
|
||||
|
|
@ -567,7 +567,7 @@ class TestUrlopen(unittest.TestCase):
|
|||
|
||||
def test_https_with_cafile(self):
|
||||
handler = self.start_https_server(certfile=CERT_localhost)
|
||||
with support.check_warnings(('', DeprecationWarning)):
|
||||
with warnings_helper.check_warnings(('', DeprecationWarning)):
|
||||
# Good cert
|
||||
data = self.urlopen("https://localhost:%s/bizarre" % handler.port,
|
||||
cafile=CERT_localhost)
|
||||
|
|
@ -585,7 +585,7 @@ class TestUrlopen(unittest.TestCase):
|
|||
def test_https_with_cadefault(self):
|
||||
handler = self.start_https_server(certfile=CERT_localhost)
|
||||
# Self-signed cert should fail verification with system certificate store
|
||||
with support.check_warnings(('', DeprecationWarning)):
|
||||
with warnings_helper.check_warnings(('', DeprecationWarning)):
|
||||
with self.assertRaises(urllib.error.URLError) as cm:
|
||||
self.urlopen("https://localhost:%s/bizarre" % handler.port,
|
||||
cadefault=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue