From 42a64c03ec5c443f2a5c2ee4284622f5d1f5326c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 17 Jan 2022 13:58:40 +0100 Subject: Revert "bpo-40066: [Enum] update str() and format() output (GH-30582)" (GH-30632) This reverts commit acf7403f9baea3ae1119fc6b4a3298522188bf96. --- Lib/test/test_ssl.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Lib/test/test_ssl.py') 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) ) -- cgit v1.2.1