tests/test_airflow_renv_operator.py
def run_command_mock_with_error(monkeypatch: MonkeyPatch):
    """Mock a SubprocessHook instance's run_command method with an error."""
    from airflow_renv_operator import SubprocessHook

    original_hook = SubprocessHook
    hook_factory_mock = make_subprocess_hook_mock(1, '[1] R raised an error')
    monkeypatch.setattr('airflow_renv_operator.SubprocessHook', hook_factory_mock)
    yield hook_factory_mock.return_value.run_command
    monkeypatch.setattr('airflow_renv_operator.SubprocessHook', original_hook)
Mock a SubprocessHook instance's run_command method with an error.
Mock a SubprocessHook instance's run_command method with an error.
Mock a SubprocessHook instance ' s run_command method with an error .
def run_command_mock_with_error(monkeypatch: MonkeyPatch):
    from airflow_renv_operator import SubprocessHook
    original_hook = SubprocessHook
    hook_factory_mock = make_subprocess_hook_mock(1, '[1] R raised an error')
    monkeypatch.setattr('airflow_renv_operator.SubprocessHook', hook_factory_mock)
    yield hook_factory_mock.return_value.run_command
    monkeypatch.setattr('airflow_renv_operator.SubprocessHook', original_hook)
def run_command_mock_with_error ( monkeypatch : MonkeyPatch ) : from airflow_renv_operator import SubprocessHook original_hook = SubprocessHook hook_factory_mock = make_subprocess_hook_mock ( 1 , '[1] R raised an error' ) monkeypatch . setattr ( 'airflow_renv_operator.SubprocessHook' , hook_factory_mock ) yield hook_factory_mock . return_value . run_command monkeypatch . setattr ( 'airflow_renv_operator.SubprocessHook' , original_hook )
Mock a SubprocessHook instance's run_command method with an error.
Mock a SubprocessHook instance ' s run_command method with an error .
"""Mock a SubprocessHook instance's run_command method with an error."""
monkeypatch
MonkeyPatch