diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-01-17 15:18:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-17 15:18:13 (GMT) |
commit | 83d544b9292870eb44f6fca37df0aa351c4ef83a (patch) | |
tree | ea79ba5ffd709ae98958ad245b92983cc51c29e5 /Lib/test/test_ssl.py | |
parent | 16901c0482734dbd389b09ca3edfcf3e22faeed7 (diff) | |
download | cpython-83d544b9292870eb44f6fca37df0aa351c4ef83a.zip cpython-83d544b9292870eb44f6fca37df0aa351c4ef83a.tar.gz cpython-83d544b9292870eb44f6fca37df0aa351c4ef83a.tar.bz2 |
bpo-40066: [Enum] skip failing doc test (GH-30637)
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index f99a3e8..64f4bce 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -373,7 +373,8 @@ class BasicSocketTests(unittest.TestCase): # Make sure that the PROTOCOL_* constants have enum-like string # reprs. proto = ssl.PROTOCOL_TLS_CLIENT - self.assertEqual(str(proto), 'PROTOCOL_TLS_CLIENT') + self.assertEqual(repr(proto), '<_SSLMethod.PROTOCOL_TLS_CLIENT: 16>') + self.assertEqual(str(proto), '16') ctx = ssl.SSLContext(proto) self.assertIs(ctx.protocol, proto) @@ -622,7 +623,7 @@ class BasicSocketTests(unittest.TestCase): with self.assertWarns(DeprecationWarning) as cm: ssl.SSLContext(protocol) self.assertEqual( - f'{protocol!r} is deprecated', + f'ssl.{protocol.name} is deprecated', str(cm.warning) ) @@ -631,8 +632,9 @@ class BasicSocketTests(unittest.TestCase): ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) with self.assertWarns(DeprecationWarning) as cm: ctx.minimum_version = version + version_text = '%s.%s' % (version.__class__.__name__, version.name) self.assertEqual( - f'ssl.{version!r} is deprecated', + f'ssl.{version_text} is deprecated', str(cm.warning) ) |