allow opt-in for using venv over virtualenv

This commit is contained in:
Jonas Obrist 2018-04-26 12:46:33 +09:00
parent 085768b673
commit 495dc33dac
2 changed files with 36 additions and 21 deletions

View file

@ -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