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

Method testClose

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

Source from the content-addressed store, hash-verified

5232
5233class TCPCloserTest(ThreadedTCPSocketTest):
5234 def testClose(self):
5235 conn, _ = self.serv.accept()
5236
5237 read, _, _ = select.select([conn], [], [], support.SHORT_TIMEOUT)
5238 self.assertEqual(read, [conn])
5239 self.assertEqual(conn.recv(1), b'x')
5240 conn.close()
5241
5242 # Calling close() many times should be safe.
5243 conn.close()
5244 conn.close()
5245
5246 def _testClose(self):
5247 self.cli.connect((HOST, self.port))

Callers

nothing calls this directly

Calls 5

acceptMethod · 0.45
selectMethod · 0.45
assertEqualMethod · 0.45
recvMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected