better no-cover for windows · precommit/pre-commit@2af0b0b · GitHub
Skip to content

Commit 2af0b0b

Browse files
committed
better no-cover for windows
1 parent 8c550d0 commit 2af0b0b

6 files changed

Lines changed: 11 additions & 15 deletions

File tree

pre_commit/file_lock.py

Lines changed: 2 additions & 2 deletions

pre_commit/languages/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_env_patch(venv):
2828
install_prefix = r'{}\bin'.format(win_venv.strip())
2929
elif sys.platform == 'win32': # pragma: no cover
3030
install_prefix = bin_dir(venv)
31-
else:
31+
else: # pragma: windows no cover
3232
install_prefix = venv
3333
return (
3434
('NODE_VIRTUAL_ENV', venv),

tests/commands/install_uninstall_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_install_refuses_core_hookspath(in_git_dir, store):
8484
assert install(C.CONFIG_FILE, store)
8585

8686

87-
@xfailif_no_symlink # pragma: no cover (non-windows)
87+
@xfailif_no_symlink # pragma: windows no cover
8888
def test_install_hooks_dead_symlink(in_git_dir, store):
8989
hook = in_git_dir.join('.git/hooks').ensure_dir().join('pre-commit')
9090
os.symlink('/fake/baz', hook.strpath)

tests/commands/run_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,8 @@ def test_include_exclude_base_case(some_filenames):
781781
]
782782

783783

784-
@xfailif_no_symlink
785-
def test_matches_broken_symlink(tmpdir): # pragma: no cover (non-windows)
784+
@xfailif_no_symlink # pragma: windows no cover
785+
def test_matches_broken_symlink(tmpdir):
786786
with tmpdir.as_cwd():
787787
os.symlink('does-not-exist', 'link')
788788
ret = _filter_by_include_exclude({'link'}, '', '^$')

tests/languages/python_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_norm_version_expanduser():
1111
if os.name == 'nt': # pragma: no cover (nt)
1212
path = r'~\python343'
1313
expected_path = r'{}\python343'.format(home)
14-
else: # pragma: no cover (non-nt)
14+
else: # pragma: windows no cover
1515
path = '~/.pyenv/versions/3.4.3/bin/python'
1616
expected_path = home + '/.pyenv/versions/3.4.3/bin/python'
1717
result = python.norm_version(path)

tests/repository_test.py

Lines changed: 4 additions & 8 deletions

0 commit comments

Comments
 (0)