Skip to content

Commit 264d44f

Browse files
authored
Add windir to the default list of pass_env variables on Windows (#3303)
1 parent 698f1dd commit 264d44f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

docs/changelog/3302.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add ``windir`` to the default list of Windows ``pass_env`` environment variables. - by :user:`kurtmckee`

src/tox/tox_env/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def _default_pass_env(self) -> list[str]: # noqa: PLR6301
231231
"USERPROFILE", # needed for `os.path.expanduser()`
232232
"PATHEXT", # needed for discovering executables
233233
"MSYSTEM", # controls paths printed format
234+
"WINDIR", # base path to system executables and DLLs
234235
],
235236
)
236237
else: # pragma: win32 no cover

tests/session/cmd/test_show_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
137137
+ (["SYSTEMDRIVE", "SYSTEMROOT", "TEMP"] if is_win else [])
138138
+ (["TERM"] if stdout_is_atty else [])
139139
+ (["TMP", "USERPROFILE"] if is_win else ["TMPDIR"])
140-
+ ["VIRTUALENV_*", "http_proxy", "https_proxy", "no_proxy"]
140+
+ ["VIRTUALENV_*"]
141+
+ (["WINDIR"] if is_win else [])
142+
+ ["http_proxy", "https_proxy", "no_proxy"]
141143
)
142144
assert pass_env == expected
143145

0 commit comments

Comments
 (0)