mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Fix pre-commit install on subst drives
This commit is contained in:
parent
0047fa35dd
commit
f9fbe18abf
2 changed files with 15 additions and 2 deletions
|
|
@ -7,7 +7,9 @@ import pytest
|
|||
import pre_commit.constants as C
|
||||
from pre_commit import main
|
||||
from pre_commit.errors import FatalError
|
||||
from pre_commit.util import cmd_output
|
||||
from testing.auto_namedtuple import auto_namedtuple
|
||||
from testing.util import cwd
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
@ -54,6 +56,17 @@ def test_adjust_args_and_chdir_relative_things(in_git_dir):
|
|||
assert args.files == [os.path.join('foo', 'f1'), os.path.join('foo', 'f2')]
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.name != 'nt', reason='windows feature')
|
||||
def test_install_on_subst(in_git_dir, store): # pragma: posix no cover
|
||||
assert not os.path.exists('Z:')
|
||||
cmd_output('subst', 'Z:', str(in_git_dir))
|
||||
try:
|
||||
with cwd('Z:'):
|
||||
test_adjust_args_and_chdir_noop('Z:\\')
|
||||
finally:
|
||||
cmd_output('subst', '/d', 'Z:')
|
||||
|
||||
|
||||
def test_adjust_args_and_chdir_non_relative_config(in_git_dir):
|
||||
in_git_dir.join('foo').ensure_dir().chdir()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue