diff options
| -rw-r--r-- | CHANGELOG | 3 | ||||
| -rw-r--r-- | tests/test_config.py | 9 | ||||
| -rw-r--r-- | tox/_config.py | 7 |
3 files changed, 16 insertions, 3 deletions
@@ -29,6 +29,9 @@ - tox has now somewhat pep8 clean code, thanks to Volodymyr Vitvitski. +- fix issue240: allow to specify empty argument list without it being + rewritten to ".". Thanks Daniel Hahler. + 1.9.2 ----------- diff --git a/tests/test_config.py b/tests/test_config.py index 0f271d7..79c98bd 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -863,6 +863,15 @@ class TestConfigTestEnv: assert argv[0] == ["cmd1", "[hello]", "world"] assert argv[1] == ["cmd1", "brave", "new", "world"] + def test_substitution_noargs_issue240(self, newconfig): + inisource = """ + [testenv] + commands = echo {posargs:foo} + """ + conf = newconfig([""], inisource).envconfigs['python'] + argv = conf.commands + assert argv[0] == ["echo"] + def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig): inisource = """ [testenv:py24] diff --git a/tox/_config.py b/tox/_config.py index afd2c55..4468d86 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -373,9 +373,10 @@ class parseini: if vc.args_are_paths: args = [] for arg in config.option.args: - origpath = config.invocationcwd.join(arg, abs=True) - if origpath.check(): - arg = vc.changedir.bestrelpath(origpath) + if arg: + origpath = config.invocationcwd.join(arg, abs=True) + if origpath.check(): + arg = vc.changedir.bestrelpath(origpath) args.append(arg) reader.addsubstitutions(args) setenv = {} |
