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

Method _test_socket_fileno

Lib/test/test_socket.py:2112–2123  ·  view source on GitHub ↗
(self, s, family, stype)

Source from the content-addressed store, hash-verified

2110 sock._sendfile_use_sendfile(File(None))
2111
2112 def _test_socket_fileno(self, s, family, stype):
2113 self.assertEqual(s.family, family)
2114 self.assertEqual(s.type, stype)
2115
2116 fd = s.fileno()
2117 s2 = socket.socket(fileno=fd)
2118 self.addCleanup(s2.close)
2119 # detach old fd to avoid double close
2120 s.detach()
2121 self.assertEqual(s2.family, family)
2122 self.assertEqual(s2.type, stype)
2123 self.assertEqual(s2.fileno(), fd)
2124
2125 def test_socket_fileno(self):
2126 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

Callers 1

test_socket_filenoMethod · 0.95

Calls 5

socketMethod · 0.80
addCleanupMethod · 0.80
assertEqualMethod · 0.45
filenoMethod · 0.45
detachMethod · 0.45

Tested by

no test coverage detected