diff options
author | holger krekel <holger@merlinux.eu> | 2016-06-20 17:38:24 +0200 |
---|---|---|
committer | holger krekel <holger@merlinux.eu> | 2016-06-20 17:38:24 +0200 |
commit | dc11f23e50f7814d332f164892a5f99109a07cb4 (patch) | |
tree | 269a420ab7938e4f9333c42aee1ae7e3d84d2523 /tests/test_config.py | |
parent | f3e6f8cda37e6fcb87992638ad52ef83eeaafa08 (diff) | |
parent | df580330eaa1bbce79012f8cfaa5c4d0a5ddf93d (diff) | |
download | tox-dc11f23e50f7814d332f164892a5f99109a07cb4.tar.gz |
add --workdir option to override where tox stores its ".tox" directory
and all of the virtualenv environment. Thanks Danring.
Diffstat (limited to 'tests/test_config.py')
-rw-r--r-- | tests/test_config.py | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 5ce99f4..86eb9f1 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -274,6 +274,34 @@ class TestIniParserAgainstCommandsKey: ["echo", "cmd", "1", "2", "3", "4", "cmd", "2"], ] + def test_command_substitution_from_other_section_posargs(self, newconfig): + """Ensure subsitition from other section with posargs succeeds""" + config = newconfig(""" + [section] + key = thing {posargs} arg2 + [testenv] + commands = + {[section]key} + """) + reader = SectionReader("testenv", config._cfg) + reader.addsubstitutions([r"argpos"]) + x = reader.getargvlist("commands") + assert x == [['thing', 'argpos', 'arg2']] + + def test_command_section_and_posargs_substitution(self, newconfig): + """Ensure subsitition from other section with posargs succeeds""" + config = newconfig(""" + [section] + key = thing arg1 + [testenv] + commands = + {[section]key} {posargs} endarg + """) + reader = SectionReader("testenv", config._cfg) + reader.addsubstitutions([r"argpos"]) + x = reader.getargvlist("commands") + assert x == [['thing', 'arg1', 'argpos', 'endarg']] + def test_command_env_substitution(self, newconfig): """Ensure referenced {env:key:default} values are substituted correctly.""" config = newconfig(""" @@ -1410,10 +1438,10 @@ class TestGlobalOptions: def test_minversion(self, tmpdir, newconfig, monkeypatch): inisource = """ [tox] - minversion = 3.0 + minversion = 10.0 """ - config = newconfig([], inisource) - assert config.minversion == "3.0" + with py.test.raises(tox.exception.MinVersionError): + config = newconfig([], inisource) def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): inisource = """ |