Merge pull request #51 from pre-commit/fix_leaky_prefixed_command_runner_test

Fix prefixed_command_runner_test to not create real directories.
This commit is contained in:
Anthony Sottile 2014-03-30 14:05:01 -07:00
commit 02660f7c0a
3 changed files with 6 additions and 1 deletions

View file

@ -79,4 +79,8 @@ class PrefixedCommandRunner(object):
"""Constructs a new command runner from an existing one by appending """Constructs a new command runner from an existing one by appending
`path_end` to the command runner's prefix directory. `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,
)

View file

@ -107,6 +107,7 @@ def test_from_command_runner_preserves_popen(popen_mock, makedirs_mock):
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
) )
makedirs_mock.assert_called_once_with('foo/bar/')
def test_create_path_if_not_exists(tmpdir): def test_create_path_if_not_exists(tmpdir):