(self)
| 3777 | |
| 3778 | @warnings_helper.ignore_fork_in_thread_deprecation_warnings() |
| 3779 | def test_spawn_close(self): |
| 3780 | # We test that a pipe connection can be closed by parent |
| 3781 | # process immediately after child is spawned. On Windows this |
| 3782 | # would have sometimes failed on old versions because |
| 3783 | # child_conn would be closed before the child got a chance to |
| 3784 | # duplicate it. |
| 3785 | conn, child_conn = self.Pipe() |
| 3786 | |
| 3787 | p = self.Process(target=self._echo, args=(child_conn,)) |
| 3788 | p.daemon = True |
| 3789 | p.start() |
| 3790 | child_conn.close() # this might complete before child initializes |
| 3791 | |
| 3792 | msg = latin('hello') |
| 3793 | conn.send_bytes(msg) |
| 3794 | self.assertEqual(conn.recv_bytes(), msg) |
| 3795 | |
| 3796 | conn.send_bytes(SENTINEL) |
| 3797 | conn.close() |
| 3798 | p.join() |
| 3799 | |
| 3800 | def test_sendbytes(self): |
| 3801 | if self.TYPE != 'processes': |
nothing calls this directly
no test coverage detected