summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Schepanovski <suor.web@gmail.com>2014-12-29 19:09:15 +0700
committerAlexander Schepanovski <suor.web@gmail.com>2014-12-29 19:09:15 +0700
commit45bc633d9c76c2e22449e5dcdbfa314e59ed4568 (patch)
treedda43abb228e16fda18a4cbdca71107208dabcff
parentac65fa83ff498ab5ee02a3cc73deef3c30619a00 (diff)
downloadtox-45bc633d9c76c2e22449e5dcdbfa314e59ed4568.tar.gz
Lessen factor use check
Fixes issue 191
-rw-r--r--tests/test_config.py12
-rw-r--r--tox/_config.py10
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index 1c58a4a..f2ecf8c 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -960,6 +960,18 @@ class TestConfigTestEnv:
assert configs["py27"].setenv["X"] == "1"
assert "X" not in configs["py26"].setenv
+ @pytest.mark.issue191
+ def test_factor_use_not_checked(self, newconfig):
+ inisource="""
+ [tox]
+ envlist = py27-{a,b}
+
+ [testenv]
+ deps = b: test
+ """
+ configs = newconfig([], inisource).envconfigs
+ assert set(configs.keys()) == set(['py27-a', 'py27-b'])
+
def test_period_in_factor(self, newconfig):
inisource="""
[tox]
diff --git a/tox/_config.py b/tox/_config.py
index 41f02ec..e93ad26 100644
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -287,10 +287,18 @@ class parseini:
config.envlist, all_envs = self._getenvdata(reader, toxsection)
- # configure testenvs
+ # factors used in config or predefined
known_factors = self._list_section_factors("testenv")
known_factors.update(default_factors)
known_factors.add("python")
+
+ # factors stated in config envlist
+ stated_envlist = reader.getdefault(toxsection, "envlist", replace=False)
+ if stated_envlist:
+ for env in _split_env(stated_envlist):
+ known_factors.update(env.split('-'))
+
+ # configure testenvs
for name in all_envs:
section = testenvprefix + name
factors = set(name.split('-'))