diff --git a/pre_commit/prefixed_command_runner.py b/pre_commit/prefixed_command_runner.py index c97ff07d..bee77016 100644 --- a/pre_commit/prefixed_command_runner.py +++ b/pre_commit/prefixed_command_runner.py @@ -79,4 +79,8 @@ class PrefixedCommandRunner(object): """Constructs a new command runner from an existing one by appending `path_end` to the command runner's prefix directory. """ - return cls(command_runner.path(path_end), popen=command_runner.__popen) + return cls( + command_runner.path(path_end), + popen=command_runner.__popen, + makedirs=command_runner.__makedirs, + ) diff --git a/tests/hooks_workspace_test.py b/tests/hooks_workspace_test.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/prefixed_command_runner_test.py b/tests/prefixed_command_runner_test.py index f75bb8a6..987b9414 100644 --- a/tests/prefixed_command_runner_test.py +++ b/tests/prefixed_command_runner_test.py @@ -107,6 +107,7 @@ def test_from_command_runner_preserves_popen(popen_mock, makedirs_mock): stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) + makedirs_mock.assert_called_once_with('foo/bar/') def test_create_path_if_not_exists(tmpdir):