mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
Revert "bpo-40066: [Enum] update str() and format() output (GH-30582)" (GH-30632)
This reverts commit acf7403f9b
.
This commit is contained in:
parent
7f4b69b907
commit
42a64c03ec
14 changed files with 2021 additions and 2087 deletions
|
@ -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)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue