diff options
| author | holger krekel <holger@merlinux.eu> | 2015-04-28 12:20:07 +0200 |
|---|---|---|
| committer | holger krekel <holger@merlinux.eu> | 2015-04-28 12:20:07 +0200 |
| commit | 93a94fc532955f0134b4535546af15871ef7dd65 (patch) | |
| tree | 699270610f9fcb58111eea6794a83115bb9cb386 | |
| parent | df8555a4febf9769b95c63d338fae7a8bba668ed (diff) | |
| download | tox-93a94fc532955f0134b4535546af15871ef7dd65.tar.gz | |
fix issue240: allow to specify empty argument list without it being
rewritten to ".". Thanks Daniel Hahler.
| -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 = {} |
