mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
allow opt-in for using venv over virtualenv
This commit is contained in:
parent
085768b673
commit
495dc33dac
2 changed files with 36 additions and 21 deletions
|
|
@ -3,6 +3,8 @@ from __future__ import unicode_literals
|
|||
|
||||
import os.path
|
||||
|
||||
import pytest
|
||||
|
||||
from pre_commit.languages import python
|
||||
|
||||
|
||||
|
|
@ -15,4 +17,14 @@ def test_norm_version_expanduser():
|
|||
path = '~/.pyenv/versions/3.4.3/bin/python'
|
||||
expected_path = home + '/.pyenv/versions/3.4.3/bin/python'
|
||||
result = python.norm_version(path)
|
||||
assert result == expected_path
|
||||
assert result == (expected_path, False)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'version,use_venv', [
|
||||
('python3.6', False),
|
||||
('python3.6+venv', True),
|
||||
],
|
||||
)
|
||||
def test_norm_version_venv(version, use_venv):
|
||||
assert python.norm_version(version)[1] == use_venv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue