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

Method test_closefd

Lib/test/_test_multiprocessing.py:5579–5603  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5577 conn.send(None)
5578
5579 def test_closefd(self):
5580 if not HAS_REDUCTION:
5581 raise unittest.SkipTest('requires fd pickling')
5582
5583 reader, writer = multiprocessing.Pipe()
5584 fd = self.get_high_socket_fd()
5585 try:
5586 p = multiprocessing.Process(target=self._test_closefds,
5587 args=(writer, fd))
5588 p.start()
5589 writer.close()
5590 e = reader.recv()
5591 join_process(p)
5592 finally:
5593 self.close(fd)
5594 writer.close()
5595 reader.close()
5596
5597 if multiprocessing.get_start_method() == 'fork':
5598 self.assertIs(e, None)
5599 else:
5600 WSAENOTSOCK = 10038
5601 self.assertIsInstance(e, OSError)
5602 self.assertTrue(e.errno == errno.EBADF or
5603 e.winerror == WSAENOTSOCK, e)
5604
5605#
5606# Issue #17097: EINTR should be ignored by recv(), send(), accept() etc

Callers

nothing calls this directly

Calls 12

get_high_socket_fdMethod · 0.95
closeMethod · 0.95
join_processFunction · 0.85
PipeMethod · 0.80
assertIsInstanceMethod · 0.80
assertTrueMethod · 0.80
ProcessMethod · 0.45
startMethod · 0.45
closeMethod · 0.45
recvMethod · 0.45
get_start_methodMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected