| 1849 | assert not hasattr(promise, "stderr") |
| 1850 | |
| 1851 | class join: |
| 1852 | # NOTE: high level Runner lifecycle mechanics of join() (re: wait(), |
| 1853 | # process_is_finished() etc) are tested in main suite. |
| 1854 | |
| 1855 | def returns_Result_on_success(self): |
| 1856 | result = _runner().run(_, asynchronous=True).join() |
| 1857 | assert isinstance(result, Result) |
| 1858 | # Sanity |
| 1859 | assert result.command == _ |
| 1860 | assert result.exited == 0 |
| 1861 | |
| 1862 | def raises_main_thread_exception_on_kaboom(self): |
| 1863 | runner = _runner(klass=_GenericExceptingRunner) |
| 1864 | with raises(_GenericException): |
| 1865 | runner.run(_, asynchronous=True).join() |
| 1866 | |
| 1867 | def raises_subthread_exception_on_their_kaboom(self): |
| 1868 | class Kaboom(_Dummy): |
| 1869 | def handle_stdout(self, **kwargs): |
| 1870 | raise OhNoz() |
| 1871 | |
| 1872 | runner = _runner(klass=Kaboom) |
| 1873 | promise = runner.run(_, asynchronous=True) |
| 1874 | with raises(ThreadException) as info: |
| 1875 | promise.join() |
| 1876 | assert isinstance(info.value.exceptions[0].value, OhNoz) |
| 1877 | |
| 1878 | def raises_Failure_on_failure(self): |
| 1879 | runner = _runner(exits=1) |
| 1880 | promise = runner.run(_, asynchronous=True) |
| 1881 | with raises(Failure): |
| 1882 | promise.join() |
| 1883 | |
| 1884 | class context_manager: |
| 1885 | def calls_join_or_wait_on_close_of_block(self): |
no outgoing calls
no test coverage detected
searching dependent graphs…