diff options
author | Bernát Gábor <bgabor8@bloomberg.net> | 2021-01-11 11:18:09 +0000 |
---|---|---|
committer | Bernát Gábor <bgabor8@bloomberg.net> | 2021-01-11 12:03:54 +0000 |
commit | 05c23cb44622024c39cc6e317fa75388aaa3c845 (patch) | |
tree | 092d243ecf021a2595ff7d718f3a780646d77b49 /tests/session | |
parent | 4cf619a95b2ab14632d2fb6e62335d792da75c37 (diff) | |
download | tox-git-05c23cb44622024c39cc6e317fa75388aaa3c845.tar.gz |
Adopt same pass env list as tox 3 has
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
Diffstat (limited to 'tests/session')
-rw-r--r-- | tests/session/cmd/test_show_config.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/session/cmd/test_show_config.py b/tests/session/cmd/test_show_config.py index 3b404e00..4cba562c 100644 --- a/tests/session/cmd/test_show_config.py +++ b/tests/session/cmd/test_show_config.py @@ -27,12 +27,6 @@ def test_show_config_default_run_env(tox_project: ToxProjectCreator, monkeypatch version = re.escape(Version(__version__).public) monkeypatch.delenv("TERM", raising=False) # disable conditionally set flag - if sys.platform == "win32": # pragma: win32 cover - p_env = ["COMSPEC", "MSYSTEM", "PATHEXT", "PROCESSOR_ARCHITECTURE", "SYSTEMROOT", "TEMP", "TMP", "USERPROFILE"] - else: # pragma: win32 no cover - p_env = ["TMPDIR"] - p_env.extend(["PIP_*", "VIRTUALENV_*", "http_proxy", "https_proxy", "no_proxy"]) - pass_env_str = "\n".join(f" {re.escape(p)}" for p in sorted(p_env))[4:] expected = rf""" \[testenv:{name}\] @@ -45,8 +39,8 @@ def test_show_config_default_run_env(tox_project: ToxProjectCreator, monkeypatch env_name = {name} env_dir = {path}{sep}\.tox4{sep}{name} env_tmp_dir = {path}{sep}\.tox4{sep}{name}{sep}tmp - pass_env = - {pass_env_str}\ + pass_env =\ + .* parallel_show_output = False description = commands = magic @@ -146,12 +140,17 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty: project = tox_project({"tox.ini": ""}) outcome = project.run("c", "-e", "py", "-k", "pass_env") pass_env = outcome.state.tox_env("py").conf["pass_env"] + is_win = sys.platform == "win32" expected = ( - (["COMSPEC", "MSYSTEM", "PATHEXT"] if sys.platform == "win32" else []) + (["COMSPEC"] if is_win else []) + + ["CURL_CA_BUNDLE", "LANG", "LANGUAGE", "LD_LIBRARY_PATH"] + + (["MSYSTEM", "PATHEXT"] if is_win else []) + ["PIP_*"] - + (["PROCESSOR_ARCHITECTURE", "SYSTEMROOT", "TEMP"] if sys.platform == "win32" else []) + + (["PROCESSOR_ARCHITECTURE"] if is_win else []) + + ["REQUESTS_CA_BUNDLE", "SSL_CERT_FILE"] + + (["SYSTEMDRIVE", "SYSTEMROOT", "TEMP"] if is_win else []) + (["TERM"] if stdout_is_atty else []) - + (["TMP", "USERPROFILE"] if sys.platform == "win32" else ["TMPDIR"]) + + (["TMP", "USERPROFILE"] if is_win else ["TMPDIR"]) + ["VIRTUALENV_*", "http_proxy", "https_proxy", "no_proxy"] ) assert pass_env == expected |