Skip to content

Commit

Permalink
Merged in andrew_pashkin/tox/issue302 (pull request #207)
Browse files Browse the repository at this point in the history
Make substitution engine ignore factor arrays, fix #302
  • Loading branch information
hpk42 committed Sep 14, 2016
2 parents 6c62be2 + 174bf2d commit f0d3b81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
26 changes: 19 additions & 7 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,20 +1154,32 @@ def test_rewrite_simple_posargs(self, tmpdir, newconfig):
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 = """
Expand Down
2 changes: 1 addition & 1 deletion tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f0d3b81

Please sign in to comment.