(self)
| 5801 | |
| 5802 | @warnings_helper.ignore_fork_in_thread_deprecation_warnings() |
| 5803 | def test_timeout(self): |
| 5804 | old_timeout = socket.getdefaulttimeout() |
| 5805 | try: |
| 5806 | socket.setdefaulttimeout(0.1) |
| 5807 | parent, child = multiprocessing.Pipe(duplex=True) |
| 5808 | l = multiprocessing.connection.Listener(family='AF_INET') |
| 5809 | p = multiprocessing.Process(target=self._test_timeout, |
| 5810 | args=(child, l.address)) |
| 5811 | p.start() |
| 5812 | child.close() |
| 5813 | self.assertEqual(parent.recv(), 123) |
| 5814 | parent.close() |
| 5815 | conn = l.accept() |
| 5816 | self.assertEqual(conn.recv(), 456) |
| 5817 | conn.close() |
| 5818 | l.close() |
| 5819 | join_process(p) |
| 5820 | finally: |
| 5821 | socket.setdefaulttimeout(old_timeout) |
| 5822 | |
| 5823 | # |
| 5824 | # Test what happens with no "if __name__ == '__main__'" |
nothing calls this directly
no test coverage detected