Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add windir to the default list of pass_env variables on Windows #3303

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/3302.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add ``windir`` to the default list of Windows ``pass_env`` environment variables. - by :user:`kurtmckee`
1 change: 1 addition & 0 deletions src/tox/tox_env/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def _default_pass_env(self) -> list[str]: # noqa: PLR6301
"USERPROFILE", # needed for `os.path.expanduser()`
"PATHEXT", # needed for discovering executables
"MSYSTEM", # controls paths printed format
"WINDIR", # base path to system executables and DLLs
],
)
else: # pragma: win32 no cover
Expand Down
4 changes: 3 additions & 1 deletion tests/session/cmd/test_show_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
+ (["SYSTEMDRIVE", "SYSTEMROOT", "TEMP"] if is_win else [])
+ (["TERM"] if stdout_is_atty else [])
+ (["TMP", "USERPROFILE"] if is_win else ["TMPDIR"])
+ ["VIRTUALENV_*", "http_proxy", "https_proxy", "no_proxy"]
+ ["VIRTUALENV_*"]
+ (["WINDIR"] if is_win else [])
+ ["http_proxy", "https_proxy", "no_proxy"]
)
assert pass_env == expected

Expand Down
Loading