From 27c33b966ec7ff975b006b21bf04245464bca52d Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 10 Nov 2026 05:49:03 +0100 Subject: [PATCH] fix: keep a test's installer run off the WSL side test_install loads its own install module. Its free-space test ran main() in process without naming the OS, so on a WSL host main() entered WSL mode and left _WSL active in that module, for the rest of the process. Any test of the module run after it, as when the module is named twice on one command line, read D:\bios as /mnt/d/bios. The test now runs as Linux and restores _WSL on exit. --- tests/test_install.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_install.py b/tests/test_install.py index 692fe0d6d..4cac497c1 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -428,7 +428,11 @@ class TheDataTreesCountInTheFreeSpace(unittest.TestCase): member = os.urandom(4096) results = [] - with FakeRepository() as repo, unittest.mock.patch.dict(os.environ): + # The run is a Linux one whatever the host: under WSL main() reads + # the Windows side and keeps that in the module, where the Windows + # detection tests run after it found D:\ turned into /mnt/d. + with FakeRepository() as repo, unittest.mock.patch.dict(os.environ, RETROBIOS_OS="linux"), \ + unittest.mock.patch.dict(install._WSL): listed = json.loads((repo.root / "install" / "retroarch.json").read_text()) listed["data_directories"] = [{ "ref": "tree", "dest": "tree", "type": "zip", "archive_size": 50_000_000,