MCPcopy Index your code
hub / github.com/RustPython/RustPython / _test_socket_fileno

Method _test_socket_fileno

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

Source from the content-addressed store, hash-verified

2059 sock._sendfile_use_sendfile(File(None))
2060
2061 def _test_socket_fileno(self, s, family, stype):
2062 self.assertEqual(s.family, family)
2063 self.assertEqual(s.type, stype)
2064
2065 fd = s.fileno()
2066 s2 = socket.socket(fileno=fd)
2067 self.addCleanup(s2.close)
2068 # detach old fd to avoid double close
2069 s.detach()
2070 self.assertEqual(s2.family, family)
2071 self.assertEqual(s2.type, stype)
2072 self.assertEqual(s2.fileno(), fd)
2073
2074 def test_socket_fileno(self):
2075 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