diff --git a/tests/test_install.py b/tests/test_install.py index 4da52996..c4dbb4ba 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -1045,6 +1045,9 @@ class DetectionFollowsTheRegistry(unittest.TestCase): env = { "HOME": str(root / "home"), "APPDATA": str(root / "appdata"), "ProgramFiles": str(root / "pf"), "ProgramFiles(x86)": str(root / "pf86"), + # Not the host's: a WSL session can hold them. + "USERPROFILE": "", "LOCALAPPDATA": "", "ProgramData": "", + "SCOOP": "", "SCOOP_GLOBAL": "", } def expand(text: str) -> str: diff --git a/tests/test_install_selection.py b/tests/test_install_selection.py index 97b969b3..07ac982f 100644 --- a/tests/test_install_selection.py +++ b/tests/test_install_selection.py @@ -362,7 +362,10 @@ class DecliningTheSizePointsAtTheChoice(unittest.TestCase): def _run(self, answers: list[str], *options: str) -> str: replies = iter(answers) out = io.StringIO() - with FakeRepository() as repo, \ + # main() on a WSL host reads the Windows variables through cmd.exe + # and sets them in os.environ: restored here, they leaked into every + # later test (USERPROFILE added a Scoop folder to detection). + with FakeRepository() as repo, mock.patch.dict(os.environ), \ mock.patch.object(sys, "argv", ["install.py", "--platform", "retroarch", "--dest", str(repo.dest), *options]), \ mock.patch.object(install, "MANIFEST_URL",