diff options
author | holger krekel <holger@merlinux.eu> | 2015-05-08 13:16:20 +0200 |
---|---|---|
committer | holger krekel <holger@merlinux.eu> | 2015-05-08 13:16:20 +0200 |
commit | 820b005c923aabf9c8724aa6ef5aea6ad4a1ac6b (patch) | |
tree | 12fa1fa3b9aae3b50d1a96664af9d5a3385a8ced /tests | |
parent | 6e2e1a62b903a29bfeca35c680789a8e959786fa (diff) | |
download | tox-820b005c923aabf9c8724aa6ef5aea6ad4a1ac6b.tar.gz |
Backed out changeset cc1933175162
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_config.py | 36 | ||||
-rw-r--r-- | tests/test_interpreters.py | 12 | ||||
-rw-r--r-- | tests/test_venv.py | 2 |
3 files changed, 32 insertions, 18 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 522a22f..79c98bd 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -6,6 +6,7 @@ import pytest import tox import tox._config from tox._config import * # noqa +from tox._config import _split_env from tox._venv import VirtualEnv @@ -1560,16 +1561,31 @@ class TestCmdInvocation: ]) -@pytest.mark.parametrize("cmdline,envlist", [ - ("-e py26", ['py26']), - ("-e py26,py33", ['py26', 'py33']), - ("-e py26,py26", ['py26', 'py26']), - ("-e py26,py33 -e py33,py27", ['py26', 'py33', 'py33', 'py27']) -]) -def test_env_spec(cmdline, envlist): - args = cmdline.split() - config = parseconfig(args) - assert config.envlist == envlist +class TestArgumentParser: + + def test_dash_e_single_1(self): + parser = prepare_parse('testpkg') + args = parser.parse_args('-e py26'.split()) + envlist = _split_env(args.env) + assert envlist == ['py26'] + + def test_dash_e_single_2(self): + parser = prepare_parse('testpkg') + args = parser.parse_args('-e py26,py33'.split()) + envlist = _split_env(args.env) + assert envlist == ['py26', 'py33'] + + def test_dash_e_same(self): + parser = prepare_parse('testpkg') + args = parser.parse_args('-e py26,py26'.split()) + envlist = _split_env(args.env) + assert envlist == ['py26', 'py26'] + + def test_dash_e_combine(self): + parser = prepare_parse('testpkg') + args = parser.parse_args('-e py26,py25,py33 -e py33,py27'.split()) + envlist = _split_env(args.env) + assert envlist == ['py26', 'py25', 'py33', 'py33', 'py27'] class TestCommandParser: diff --git a/tests/test_interpreters.py b/tests/test_interpreters.py index a6997e6..1c5a77d 100644 --- a/tests/test_interpreters.py +++ b/tests/test_interpreters.py @@ -3,13 +3,11 @@ import os import pytest from tox.interpreters import * # noqa -from tox._config import get_plugin_manager @pytest.fixture def interpreters(): - pm = get_plugin_manager() - return Interpreters(hook=pm.hook) + return Interpreters() @pytest.mark.skipif("sys.platform != 'win32'") @@ -30,8 +28,8 @@ def test_locate_via_py(monkeypatch): assert locate_via_py('3', '2') == sys.executable -def test_tox_get_python_executable(): - p = tox_get_python_executable(sys.executable) +def test_find_executable(): + p = find_executable(sys.executable) assert p == py.path.local(sys.executable) for ver in [""] + "2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3".split(): name = "python%s" % ver @@ -44,7 +42,7 @@ def test_tox_get_python_executable(): else: if not py.path.local.sysfind(name): continue - p = tox_get_python_executable(name) + p = find_executable(name) assert p popen = py.std.subprocess.Popen([str(p), '-V'], stderr=py.std.subprocess.PIPE) @@ -57,7 +55,7 @@ def test_find_executable_extra(monkeypatch): def sysfind(x): return "hello" monkeypatch.setattr(py.path.local, "sysfind", sysfind) - t = tox_get_python_executable("qweqwe") + t = find_executable("qweqwe") assert t == "hello" diff --git a/tests/test_venv.py b/tests/test_venv.py index 80ec519..538b7e5 100644 --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -65,7 +65,7 @@ def test_create(monkeypatch, mocksession, newconfig): # assert Envconfig.toxworkdir in args assert venv.getcommandpath("easy_install", cwd=py.path.local()) interp = venv._getliveconfig().python - assert interp == venv.envconfig.python_info.executable + assert interp == venv.envconfig._basepython_info.executable assert venv.path_config.check(exists=False) |