diff options
-rw-r--r-- | tests/test_config.py | 26 | ||||
-rw-r--r-- | tox/config.py | 2 |
2 files changed, 20 insertions, 8 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 9eb955d..d685ac8 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1154,20 +1154,32 @@ class TestConfigTestEnv: argv = conf.commands assert argv[0] == ["cmd1", "hello"] - def test_take_dependencies_from_other_testenv(self, newconfig): + @pytest.mark.parametrize('envlist, deps', [ + (['py27'], ('pytest', 'pytest-cov')), + (['py27', 'py34'], ('pytest', 'py{27,34}: pytest-cov')), + ]) + def test_take_dependencies_from_other_testenv( + self, + newconfig, + envlist, + deps + ): inisource = """ + [tox] + envlist = {envlist} [testenv] - deps= - pytest - pytest-cov + deps={deps} [testenv:py27] deps= - {[testenv]deps} + {{[testenv]deps}} fun - """ + """.format( + envlist=','.join(envlist), + deps='\n' + '\n'.join([' ' * 17 + d for d in deps]) + ) conf = newconfig([], inisource).envconfigs['py27'] packages = [dep.name for dep in conf.deps] - assert packages == ['pytest', 'pytest-cov', 'fun'] + assert packages == list(deps) + ['fun'] def test_take_dependencies_from_other_section(self, newconfig): inisource = """ diff --git a/tox/config.py b/tox/config.py index ad453f6..d6b4c52 100644 --- a/tox/config.py +++ b/tox/config.py @@ -1017,7 +1017,7 @@ class Replacer: r''' (?<!\\)[{] (?:(?P<sub_type>[^[:{}]+):)? # optional sub_type for special rules - (?P<substitution_value>[^{}]*) # substitution key + (?P<substitution_value>[^,{}]*) # substitution key [}] ''', re.VERBOSE) |