diff options
author | Paul Moore <p.f.moore@gmail.com> | 2016-02-03 14:25:34 +0000 |
---|---|---|
committer | Paul Moore <p.f.moore@gmail.com> | 2016-02-03 14:31:52 +0000 |
commit | 7fb7799525dea384b14ea445239d96c89c32b71a (patch) | |
tree | a973d114d89376510297ff5b692fdd46954d0537 | |
parent | 9dbe04fd968cec88fd4ec32a6aa71e117c9c8580 (diff) | |
download | virtualenv-7fb7799525dea384b14ea445239d96c89c32b71a.tar.gz |
Move the command line tests from tox.ini to a proper test file
-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] |