mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 09:04:41 +04:00
force the -p branch to run for language: python under test
This commit is contained in:
parent
92c70766fd
commit
b92fe01755
1 changed files with 14 additions and 7 deletions
|
|
@ -173,13 +173,20 @@ def test_python_venv(tempdir_factory, store):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_versioned_python_hook(tempdir_factory, store):
|
def test_language_versioned_python_hook(tempdir_factory, store):
|
||||||
_test_hook_repo(
|
# we patch this force virtualenv executing with `-p` since we can't
|
||||||
tempdir_factory, store, 'python3_hooks_repo',
|
# reliably have multiple pythons available in CI
|
||||||
'python3-hook',
|
with mock.patch.object(
|
||||||
[os.devnull],
|
python,
|
||||||
f'3\n[{os.devnull!r}]\nHello World\n'.encode(),
|
'_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(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@skipif_cant_run_coursier # pragma: win32 no cover
|
@skipif_cant_run_coursier # pragma: win32 no cover
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue