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

Method test_ignore

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

Source from the content-addressed store, hash-verified

5958 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
5959 @unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
5960 def test_ignore(self):
5961 conn, child_conn = multiprocessing.Pipe()
5962 try:
5963 p = multiprocessing.Process(target=self._test_ignore,
5964 args=(child_conn,))
5965 p.daemon = True
5966 p.start()
5967 child_conn.close()
5968 self.assertEqual(conn.recv(), 'ready')
5969 time.sleep(0.1)
5970 os.kill(p.pid, signal.SIGUSR1)
5971 time.sleep(0.1)
5972 conn.send(1234)
5973 self.assertEqual(conn.recv(), 1234)
5974 time.sleep(0.1)
5975 os.kill(p.pid, signal.SIGUSR1)
5976 self.assertEqual(conn.recv_bytes(), b'x' * self.CONN_MAX_SIZE)
5977 time.sleep(0.1)
5978 p.join()
5979 finally:
5980 conn.close()
5981
5982 @classmethod
5983 def _test_ignore_listener(cls, conn):

Callers

nothing calls this directly

Calls 11

PipeMethod · 0.80
ProcessMethod · 0.45
startMethod · 0.45
closeMethod · 0.45
assertEqualMethod · 0.45
recvMethod · 0.45
sleepMethod · 0.45
killMethod · 0.45
sendMethod · 0.45
recv_bytesMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected