summaryrefslogtreecommitdiffstats
path: root/tests/main_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-08 17:48:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-08 17:48:47 +0000
commit4db15c5b771323f1acdeb06e4acc671856da5ea9 (patch)
tree1cde2767753275f2f87a34a2606b2415a467ff09 /tests/main_test.py
parentAdding upstream version 2.10.1. (diff)
downloadpre-commit-4db15c5b771323f1acdeb06e4acc671856da5ea9.tar.xz
pre-commit-4db15c5b771323f1acdeb06e4acc671856da5ea9.zip
Adding upstream version 2.11.0.upstream/2.11.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/main_test.py')
-rw-r--r--tests/main_test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/main_test.py b/tests/main_test.py
index 2460bd8..1ad8d41 100644
--- a/tests/main_test.py
+++ b/tests/main_test.py
@@ -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()