diff options
-rw-r--r-- | Doc/library/ssl.rst | 2 | ||||
-rwxr-xr-x | Lib/test/test_socket.py | 16 | ||||
-rw-r--r-- | Lib/test/test_ssl.py | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 4d8488a..151f254 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -2081,7 +2081,7 @@ to speed up repeated connections from the same clients. .. versionchanged:: 3.6 :attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum: - >>> ssl.create_default_context().verify_mode + >>> ssl.create_default_context().verify_mode # doctest: +SKIP <VerifyMode.CERT_REQUIRED: 2> .. index:: single: certificates diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 56cc23d..53aa5e9 100755 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1517,11 +1517,11 @@ class GeneralModuleTests(unittest.TestCase): infos = socket.getaddrinfo(HOST, 80, socket.AF_INET, socket.SOCK_STREAM) for family, type, _, _, _ in infos: self.assertEqual(family, socket.AF_INET) - self.assertEqual(repr(family), '<AddressFamily.AF_INET: 2>') - self.assertEqual(str(family), '2') + self.assertEqual(repr(family), '<AddressFamily.AF_INET: %r>' % family.value) + self.assertEqual(str(family), str(family.value)) self.assertEqual(type, socket.SOCK_STREAM) - self.assertEqual(repr(type), '<SocketKind.SOCK_STREAM: 1>') - self.assertEqual(str(type), '1') + self.assertEqual(repr(type), '<SocketKind.SOCK_STREAM: %r>' % type.value) + self.assertEqual(str(type), str(type.value)) infos = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM) for _, socktype, _, _, _ in infos: self.assertEqual(socktype, socket.SOCK_STREAM) @@ -1795,10 +1795,10 @@ class GeneralModuleTests(unittest.TestCase): # Make sure that the AF_* and SOCK_* constants have enum-like string # reprs. with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: - self.assertEqual(repr(s.family), '<AddressFamily.AF_INET: 2>') - self.assertEqual(repr(s.type), '<SocketKind.SOCK_STREAM: 1>') - self.assertEqual(str(s.family), '2') - self.assertEqual(str(s.type), '1') + self.assertEqual(repr(s.family), '<AddressFamily.AF_INET: %r>' % s.family.value) + self.assertEqual(repr(s.type), '<SocketKind.SOCK_STREAM: %r>' % s.type.value) + self.assertEqual(str(s.family), str(s.family.value)) + self.assertEqual(str(s.type), str(s.type.value)) def test_socket_consistent_sock_type(self): SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 64f4bce..543d34a 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -373,8 +373,8 @@ 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(repr(proto), '<_SSLMethod.PROTOCOL_TLS_CLIENT: %r>' % proto.value) + self.assertEqual(str(proto), str(proto.value)) ctx = ssl.SSLContext(proto) self.assertIs(ctx.protocol, proto) |