t/unit/test_dummy.py
raw| 1 | import threading |
| 2 | import billiard.dummy |
| 3 | |
| 4 | |
| 5 | class test_restart_state: |
| 6 | def test_raises(self): |
| 7 | class Thread(threading.Thread): |
| 8 | exception = None |
| 9 | |
| 10 | def run(self): |
| 11 | try: |
| 12 | billiard.dummy.Process().start() |
| 13 | except BaseException as e: |
| 14 | self.exception = e |
| 15 | |
| 16 | thread = Thread() |
| 17 | thread.start() |
| 18 | thread.join(0.1) |
| 19 | assert not thread.is_alive() |
| 20 | assert thread.exception is None |