MCPcopy Index your code
hub / github.com/python/cpython / testInheritFlagsTimeout

Method testInheritFlagsTimeout

Lib/test/test_socket.py:5482–5491  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5480 self.cli.connect((HOST, self.port))
5481
5482 def testInheritFlagsTimeout(self):
5483 # bpo-7995: accept() on a listening socket with a timeout and the
5484 # default timeout is None, the resulting socket must inherit
5485 # the default timeout.
5486 default_timeout = 20.0
5487 with socket_setdefaulttimeout(default_timeout):
5488 self.serv.settimeout(10)
5489 conn, addr = self.serv.accept()
5490 self.addCleanup(conn.close)
5491 self.assertEqual(conn.gettimeout(), default_timeout)
5492
5493 def _testInheritFlagsTimeout(self):
5494 self.cli.connect((HOST, self.port))

Callers

nothing calls this directly

Calls 6

socket_setdefaulttimeoutFunction · 0.85
addCleanupMethod · 0.80
settimeoutMethod · 0.45
acceptMethod · 0.45
assertEqualMethod · 0.45
gettimeoutMethod · 0.45

Tested by

no test coverage detected