diff options
-rw-r--r-- | tests/test_cmdline.py | 37 | ||||
-rw-r--r-- | tox.ini | 3 |
2 files changed, 37 insertions, 3 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py new file mode 100644 index 0000000..c157de3 --- /dev/null +++ b/tests/test_cmdline.py @@ -0,0 +1,37 @@ +import sys +import subprocess +import virtualenv + +VIRTUALENV_SCRIPT = virtualenv.__file__ + +def test_commandline_basic(tmpdir): + """Simple command line usage should work""" + subprocess.check_call([ + sys.executable, + VIRTUALENV_SCRIPT, + str(tmpdir.join('venv')) + ]) + +def test_commandline_explicit_interp(tmpdir): + """Specifying the Python interpreter should work""" + subprocess.check_call([ + sys.executable, + VIRTUALENV_SCRIPT, + '-p', sys.executable, + str(tmpdir.join('venv')) + ]) + +def test_commandline_abbrev_interp(tmpdir): + """Specifying abbreviated forms of the Python interpreter should work""" + if sys.platform == 'win32': + fmt = 'py%s%s' + else: + fmt = 'python%s.%s' + abbrev = fmt % (sys.version_info[0], sys.version_info[1]) + subprocess.check_call([ + sys.executable, + VIRTUALENV_SCRIPT, + '-p', abbrev, + str(tmpdir.join('venv')) + ]) + @@ -10,9 +10,6 @@ deps = pytest commands = py.test - python virtualenv.py {envtmpdir}/venv - python virtualenv.py -p {envname} {envtmpdir}/{envname} - python virtualenv.py --python={envpython} {envtmpdir}/{envname}-fullpath # Creating a python3 venv with a python2-based virtualenv [testenv:crosspython2] |