Skip to content

Commit

Permalink
Add windir to the default list of pass_env variables on Windows (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtmckee authored Jul 1, 2024
1 parent 698f1dd commit 264d44f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
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

0 comments on commit 264d44f

Please sign in to comment.