diff options
-rw-r--r-- | tests/test_config.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index b8d0aa3..c4ec9cc 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -663,6 +663,23 @@ class TestConfigTestEnv: assert argv[0] == ["cmd1", "[hello]", "world"] assert argv[1] == ["cmd1", "brave", "new", "world"] + def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig): + inisource = """ + [testenv:py24] + commands = + echo "\{posargs\}" = {posargs} + echo "posargs = " "{posargs}" + """ + conf = newconfig([], inisource).envconfigs['py24'] + argv = conf.commands + assert argv[0] == ['echo', '\\{posargs\\}', '='] + assert argv[1] == ['echo', 'posargs ='] + + conf = newconfig(['dog', 'cat'], inisource).envconfigs['py24'] + argv = conf.commands + assert argv[0] == ['echo', '\\{posargs\\}', '=', 'dog', 'cat'] + assert argv[1] == ['echo', 'posargs =', 'dog', 'cat'] + def test_rewrite_posargs(self, tmpdir, newconfig): inisource = """ [testenv:py24] |