| OLD | NEW |
| (Empty) | |
| 1 import sys |
| 2 import subprocess |
| 3 import virtualenv |
| 4 import pytest |
| 5 |
| 6 VIRTUALENV_SCRIPT = virtualenv.__file__ |
| 7 |
| 8 def test_commandline_basic(tmpdir): |
| 9 """Simple command line usage should work""" |
| 10 subprocess.check_call([ |
| 11 sys.executable, |
| 12 VIRTUALENV_SCRIPT, |
| 13 str(tmpdir.join('venv')) |
| 14 ]) |
| 15 |
| 16 def test_commandline_explicit_interp(tmpdir): |
| 17 """Specifying the Python interpreter should work""" |
| 18 subprocess.check_call([ |
| 19 sys.executable, |
| 20 VIRTUALENV_SCRIPT, |
| 21 '-p', sys.executable, |
| 22 str(tmpdir.join('venv')) |
| 23 ]) |
| 24 |
| 25 # The registry lookups to support the abbreviated "-p 3.5" form of specifying |
| 26 # a Python interpreter on Windows don't seem to work with Python 3.5. The |
| 27 # registry layout is not well documented, and it's not clear that the feature |
| 28 # is sufficiently widely used to be worth fixing. |
| 29 # See https://github.com/pypa/virtualenv/issues/864 |
| 30 @pytest.mark.skipif("sys.platform == 'win32' and sys.version_info[:2] >= (3,5)") |
| 31 def test_commandline_abbrev_interp(tmpdir): |
| 32 """Specifying abbreviated forms of the Python interpreter should work""" |
| 33 if sys.platform == 'win32': |
| 34 fmt = '%s.%s' |
| 35 else: |
| 36 fmt = 'python%s.%s' |
| 37 abbrev = fmt % (sys.version_info[0], sys.version_info[1]) |
| 38 subprocess.check_call([ |
| 39 sys.executable, |
| 40 VIRTUALENV_SCRIPT, |
| 41 '-p', abbrev, |
| 42 str(tmpdir.join('venv')) |
| 43 ]) |
| 44 |
| OLD | NEW |