summaryrefslogtreecommitdiff
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-01-17 13:58:40 +0100
committerGitHub <noreply@github.com>2022-01-17 13:58:40 +0100
commit42a64c03ec5c443f2a5c2ee4284622f5d1f5326c (patch)
treed5fffd97234c4a8481ee3f07a69107188f1faa7d /Lib/test/test_ssl.py
parent7f4b69b9076bdbcea31f6ad16eb125ee99cf0175 (diff)
downloadcpython-git-42a64c03ec5c443f2a5c2ee4284622f5d1f5326c.tar.gz
Revert "bpo-40066: [Enum] update str() and format() output (GH-30582)" (GH-30632)
This reverts commit acf7403f9baea3ae1119fc6b4a3298522188bf96.
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 64f4bce7f7..f99a3e8da9 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -373,8 +373,7 @@ class BasicSocketTests(unittest.TestCase):
# Make sure that the PROTOCOL_* constants have enum-like string
# reprs.
proto = ssl.PROTOCOL_TLS_CLIENT
- self.assertEqual(repr(proto), '<_SSLMethod.PROTOCOL_TLS_CLIENT: 16>')
- self.assertEqual(str(proto), '16')
+ self.assertEqual(str(proto), 'PROTOCOL_TLS_CLIENT')
ctx = ssl.SSLContext(proto)
self.assertIs(ctx.protocol, proto)
@@ -623,7 +622,7 @@ class BasicSocketTests(unittest.TestCase):
with self.assertWarns(DeprecationWarning) as cm:
ssl.SSLContext(protocol)
self.assertEqual(
- f'ssl.{protocol.name} is deprecated',
+ f'{protocol!r} is deprecated',
str(cm.warning)
)
@@ -632,9 +631,8 @@ 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_text} is deprecated',
+ f'ssl.{version!r} is deprecated',
str(cm.warning)
)