MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / test_task_popen_exception

Function test_task_popen_exception

tools-tests/tasks_test.py:127–135  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

125
126
127def 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])

Callers

nothing calls this directly

Calls 2

runMethod · 0.95
readMethod · 0.80

Tested by

no test coverage detected