summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormazzucco <devnull@localhost>2015-06-18 10:50:48 +0100
committermazzucco <devnull@localhost>2015-06-18 10:50:48 +0100
commite137fb2b2336f6c9f20e4789527b82cd89e502b2 (patch)
treeee8cd0a4e422646dbdecca77184903431833e5d1 /tests
parentc29c60b2d5d422b50882c0788e17a8f6d7fe1f56 (diff)
downloadtox-e137fb2b2336f6c9f20e4789527b82cd89e502b2.tar.gz
hpk42/tox/issue/259/passenv-statement-should-accept-multi-line
Diffstat (limited to 'tests')
-rw-r--r--tests/test_config.py34
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index 4522f87..f85b563 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -696,14 +696,44 @@ class TestConfigTestEnv:
assert envconfig.setenv['ANOTHER_VAL'] == 'else'
@pytest.mark.parametrize("plat", ["win32", "linux2"])
- def test_passenv(self, tmpdir, newconfig, monkeypatch, plat):
+ def test_passenv_as_multiline_list(self, tmpdir, newconfig, monkeypatch, plat):
monkeypatch.setattr(sys, "platform", plat)
monkeypatch.setenv("A123A", "a")
monkeypatch.setenv("A123B", "b")
monkeypatch.setenv("BX23", "0")
config = newconfig("""
[testenv]
- passenv = A123* B?23
+ passenv =
+ A123*
+ # isolated comment
+ B?23
+ """)
+ assert len(config.envconfigs) == 1
+ envconfig = config.envconfigs['python']
+ if plat == "win32":
+ assert "PATHEXT" in envconfig.passenv
+ assert "SYSTEMDRIVE" in envconfig.passenv
+ assert "SYSTEMROOT" in envconfig.passenv
+ assert "TEMP" in envconfig.passenv
+ assert "TMP" in envconfig.passenv
+ else:
+ assert "TMPDIR" in envconfig.passenv
+ assert "PATH" in envconfig.passenv
+ assert "PIP_INDEX_URL" in envconfig.passenv
+ assert "LANG" in envconfig.passenv
+ assert "A123A" in envconfig.passenv
+ assert "A123B" in envconfig.passenv
+
+ @pytest.mark.parametrize("plat", ["win32", "linux2"])
+ def test_passenv_as_space_separated_list(self, tmpdir, newconfig, monkeypatch, plat):
+ monkeypatch.setattr(sys, "platform", plat)
+ monkeypatch.setenv("A123A", "a")
+ monkeypatch.setenv("A123B", "b")
+ monkeypatch.setenv("BX23", "0")
+ config = newconfig("""
+ [testenv]
+ passenv =
+ A123* B?23
""")
assert len(config.envconfigs) == 1
envconfig = config.envconfigs['python']