mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-40066: [Enum] skip failing doc test (GH-30637)
This commit is contained in:
parent
16901c0482
commit
83d544b929
14 changed files with 2085 additions and 2019 deletions
|
@ -1517,9 +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(str(family), 'AF_INET')
|
||||
self.assertEqual(repr(family), '<AddressFamily.AF_INET: 2>')
|
||||
self.assertEqual(str(family), '2')
|
||||
self.assertEqual(type, socket.SOCK_STREAM)
|
||||
self.assertEqual(str(type), 'SOCK_STREAM')
|
||||
self.assertEqual(repr(type), '<SocketKind.SOCK_STREAM: 1>')
|
||||
self.assertEqual(str(type), '1')
|
||||
infos = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM)
|
||||
for _, socktype, _, _, _ in infos:
|
||||
self.assertEqual(socktype, socket.SOCK_STREAM)
|
||||
|
@ -1793,8 +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(str(s.family), 'AF_INET')
|
||||
self.assertEqual(str(s.type), 'SOCK_STREAM')
|
||||
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')
|
||||
|
||||
def test_socket_consistent_sock_type(self):
|
||||
SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue