From a06d5df17553b2ef51b092b1aa83db35f967c546 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 26 Sep 2014 15:36:48 +0000 Subject: Allow "." in factor names for multi-dimensional tests. --- tox/_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox/_config.py b/tox/_config.py index 3c1b8c2..5e8765b 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -305,7 +305,7 @@ class parseini: factors = set() if section in self._cfg: for _, value in self._cfg[section].items(): - exprs = re.findall(r'^([\w{},-]+)\:\s+', value, re.M) + exprs = re.findall(r'^([\w{}\.,-]+)\:\s+', value, re.M) factors.update(*mapcat(_split_factor_expr, exprs)) return factors -- cgit v1.2.1 From 73e938245015e1e19ae6decd6671be3b98c06c60 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 26 Sep 2014 19:32:11 +0000 Subject: Added a test for period in factor --- tests/test_config.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index bf74133..615de30 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -909,6 +909,14 @@ class TestConfigTestEnv: configs = newconfig([], inisource).envconfigs assert configs["py27"].setenv["X"] == "1" assert "X" not in configs["py26"].setenv + + def test_period_in_factor(self, newconfig): + inisource=""" + [tox] + envlist = py27-{django1.6,django1.7} + """ + configs = newconfig([], inisource).envconfigs + assert list(configs) == ["py27-django1.6", "py27-django-1.7"] class TestGlobalOptions: -- cgit v1.2.1 From f21eb4bba1e7d18b7718aeaadb9384dd74fcf8e6 Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Sun, 12 Oct 2014 23:10:19 +0800 Subject: Recognize period in envnames in factor conditions --- tests/test_config.py | 15 +++++++++++---- tox/_config.py | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 615de30..43b5a34 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -909,14 +909,21 @@ class TestConfigTestEnv: configs = newconfig([], inisource).envconfigs assert configs["py27"].setenv["X"] == "1" assert "X" not in configs["py26"].setenv - + def test_period_in_factor(self, newconfig): inisource=""" - [tox] - envlist = py27-{django1.6,django1.7} + [tox] + envlist = py27-{django1.6,django1.7} + + [testenv] + deps = + django1.6: Django==1.6 + django1.7: Django==1.7 """ configs = newconfig([], inisource).envconfigs - assert list(configs) == ["py27-django1.6", "py27-django-1.7"] + assert sorted(configs) == ["py27-django1.6", "py27-django1.7"] + assert [d.name for d in configs["py27-django1.6"].deps] \ + == ["Django==1.6"] class TestGlobalOptions: diff --git a/tox/_config.py b/tox/_config.py index 5e8765b..5d259c4 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -642,7 +642,7 @@ class IniReader: def _apply_factors(self, s): def factor_line(line): - m = re.search(r'^([\w{},-]+)\:\s+(.+)', line) + m = re.search(r'^([\w{}\.,-]+)\:\s+(.+)', line) if not m: return line -- cgit v1.2.1