diff options
| -rw-r--r-- | tests/test_config.py | 13 | ||||
| -rw-r--r-- | tox/_config.py | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 1c58a4a..229f035 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -960,6 +960,19 @@ class TestConfigTestEnv: assert configs["py27"].setenv["X"] == "1" assert "X" not in configs["py26"].setenv + @pytest.mark.issue198 + def test_factors_groups_touch(self, newconfig): + inisource=""" + [tox] + envlist = {a,b}{-x,} + + [testenv] + deps= + a,b,x,y: dep + """ + configs = newconfig([], inisource).envconfigs + assert set(configs.keys()) == set(['a', 'a-x', 'b', 'b-x']) + def test_period_in_factor(self, newconfig): inisource=""" [tox] diff --git a/tox/_config.py b/tox/_config.py index 41f02ec..82154e3 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -456,7 +456,7 @@ def _split_factor_expr(expr): def _expand_envstr(envstr): # split by commas not in groups - tokens = re.split(r'(\{[^}]+\})|,', envstr) + tokens = re.split(r'((?:\{[^}]+\})+)|,', envstr) envlist = [''.join(g).strip() for k, g in itertools.groupby(tokens, key=bool) if k] |
