Merge pull request #2767 from pre-commit/test-more-directly

test things more directly to improve coverage
This commit is contained in:
Anthony Sottile 2023-02-20 18:52:11 -05:00 committed by GitHub
commit 4f6ba18cad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 16 deletions

View file

@ -143,22 +143,6 @@ def test_python_venv_deprecation(store, caplog):
)
def test_language_versioned_python_hook(tempdir_factory, store):
# we patch this force virtualenv executing with `-p` since we can't
# reliably have multiple pythons available in CI
with mock.patch.object(
python,
'_sys_executable_matches',
return_value=False,
):
_test_hook_repo(
tempdir_factory, store, 'python3_hooks_repo',
'python3-hook',
[os.devnull],
f'3\n[{os.devnull!r}]\nHello World\n'.encode(),
)
def test_system_hook_with_spaces(tempdir_factory, store):
_test_hook_repo(
tempdir_factory, store, 'system_hook_with_spaces_repo',