diff options
| author | holger krekel <holger@merlinux.eu> | 2015-11-11 15:58:33 +0100 |
|---|---|---|
| committer | holger krekel <holger@merlinux.eu> | 2015-11-11 15:58:33 +0100 |
| commit | a925190c8cc9600411b0e7c0e76a03a0ee40b1b3 (patch) | |
| tree | 213f0d8261c398d8ab53e089ff6595318d01c6a0 /tests/test_config.py | |
| parent | 4ea2f08501c99bca26e5d4b42b7a85c1a3eb2a98 (diff) | |
| download | tox-git-2.2.1.tar.gz | |
fix setenv/substitution bug2.2.1
Diffstat (limited to 'tests/test_config.py')
| -rw-r--r-- | tests/test_config.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 16e1e573..61047c1f 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -738,6 +738,32 @@ class TestConfigTestEnv: assert envconfig.setenv['PYTHONPATH'] == 'something' assert envconfig.setenv['ANOTHER_VAL'] == 'else' + def test_setenv_with_envdir_and_basepython(self, tmpdir, newconfig): + config = newconfig(""" + [testenv] + setenv = + VAL = {envdir} + basepython = {env:VAL} + """) + assert len(config.envconfigs) == 1 + envconfig = config.envconfigs['python'] + assert 'VAL' in envconfig.setenv + assert envconfig.setenv['VAL'] == envconfig.envdir + assert envconfig.basepython == envconfig.envdir + + def test_setenv_ordering_1(self, tmpdir, newconfig): + config = newconfig(""" + [testenv] + setenv= + VAL={envdir} + commands=echo {env:VAL} + """) + assert len(config.envconfigs) == 1 + envconfig = config.envconfigs['python'] + assert 'VAL' in envconfig.setenv + assert envconfig.setenv['VAL'] == envconfig.envdir + assert str(envconfig.envdir) in envconfig.commands[0] + @pytest.mark.parametrize("plat", ["win32", "linux2"]) def test_passenv_as_multiline_list(self, tmpdir, newconfig, monkeypatch, plat): monkeypatch.setattr(sys, "platform", plat) |
