(tmp_path)
| 125 | |
| 126 | |
| 127 | def test_task_popen_exception(tmp_path): |
| 128 | task = tasks.AllOsTask("test_task", ["notacommand"], timeout=0.01) |
| 129 | runner = tasks.TaskRunner(tmp_dir=tmp_path) |
| 130 | with unittest.mock.patch("subprocess.Popen") as popen: |
| 131 | popen.side_effect = OSError("Boom!") |
| 132 | runner.run(task) |
| 133 | |
| 134 | with open(pathlib.Path(runner.tmpdir) / runner.default_name) as fh: |
| 135 | assert "Failed to execute ['notacommand']: Boom!" in fh.read() |
| 136 | |
| 137 | |
| 138 | @pytest.mark.parametrize("verbosity", [0, 1, 2]) |