summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2015-11-09 11:26:26 +0100
committerholger krekel <holger@merlinux.eu>2015-11-09 11:26:26 +0100
commit83a9e65188162cc4c36f61e6c3e4c88f47b6a03e (patch)
tree7dcf4f57065efbe38b8d42336565ad2756f0ba37
parent5cb2ee008a8fb77b8419e26773639dc4530c0620 (diff)
downloadtox-83a9e65188162cc4c36f61e6c3e4c88f47b6a03e.tar.gz
fix issue280: fix case where --skip-missing-interpreter would not work if {envsitepackagesdir} substitution was used.
-rw-r--r--CHANGELOG3
-rw-r--r--tests/test_z_cmdline.py19
-rw-r--r--tox/config.py1
3 files changed, 20 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 6e3825a..84bb63c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -19,6 +19,9 @@
of an error on a failed testenv command outcome.
Thanks Rebecka Gulliksson for the PR.
+- fix issue280: properly skip missing interpreter if
+ {envsitepackagesdir} is present in commands. Thanks BB:ceridwenv
+
2.1.1
----------
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py
index b288880..994d4ec 100644
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -692,8 +692,7 @@ def test_installpkg(tmpdir, newconfig):
assert sdist_path == p
-@pytest.mark.xfail("sys.platform == 'win32' and sys.version_info < (2,6)",
- reason="test needs better impl")
+@pytest.mark.xfail("sys.platform == 'win32'", reason="test needs better impl")
def test_envsitepackagesdir(cmd, initproj):
initproj("pkg512-0.0.5", filedefs={
'tox.ini': """
@@ -708,6 +707,22 @@ def test_envsitepackagesdir(cmd, initproj):
""")
+@pytest.mark.xfail("sys.platform == 'win32'", reason="test needs better impl")
+def test_envsitepackagesdir_skip_missing_issue280(cmd, initproj):
+ initproj("pkg513-0.0.5", filedefs={
+ 'tox.ini': """
+ [testenv]
+ basepython=/usr/bin/qwelkjqwle
+ commands=
+ {envsitepackagesdir}
+ """})
+ result = cmd.run("tox", "--skip-missing-interpreters")
+ assert result.ret == 0
+ result.stdout.fnmatch_lines("""
+ SKIPPED:*qwelkj*
+ """)
+
+
def verify_json_report_format(data, testenvs=True):
assert data["reportversion"] == "1"
assert data["toxversion"] == tox.__version__
diff --git a/tox/config.py b/tox/config.py
index 40c6e0a..7676127 100644
--- a/tox/config.py
+++ b/tox/config.py
@@ -539,7 +539,6 @@ class TestenvConfig:
""" return sitepackagesdir of the virtualenv environment.
(only available during execution, not parsing)
"""
- self.getsupportedinterpreter() # for throwing exceptions
x = self.config.interpreters.get_sitepackagesdir(
info=self.python_info,
envdir=self.envdir)