From 93a94fc532955f0134b4535546af15871ef7dd65 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 28 Apr 2015 12:20:07 +0200 Subject: fix issue240: allow to specify empty argument list without it being rewritten to ".". Thanks Daniel Hahler. --- CHANGELOG | 3 +++ tests/test_config.py | 9 +++++++++ tox/_config.py | 7 ++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b3e9f7e..29008b0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 = {} -- cgit v1.2.1