def test_task_run(runtime): DummyTask._run_task = Mock() multi_cmd = cci.RunTaskCommand() cmd = multi_cmd.get_command(Mock, "dummy-task") run_click_command(cmd, "dummy-task", color="blue", runtime=runtime) DummyTask._run_task.assert_called_once()
def test_task_run__debug_after(runtime): DummyTask._run_task = Mock() multi_cmd = cci.RunTaskCommand() set_trace = Mock(side_effect=SetTrace) with patch("pdb.set_trace", set_trace): with pytest.raises(SetTrace): cmd = multi_cmd.get_command(Mock(), "dummy-task") run_click_command( cmd, "dummy-task", color="blue", debug_before=False, debug_after=True, runtime=runtime, )