From c14e1af87f92cb6f026d569ea521cf5c8df5597d Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Sat, 31 Oct 2026 20:09:07 -0700 Subject: [PATCH] test(memory): let the musl test fake os.confstr on Windows (#523) The portability run on main fails since #523: Windows has no os.confstr, so patching it without create=True raises before the test runs. --- tests/test_native_memory.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_native_memory.py b/tests/test_native_memory.py index c1892a33..b922f7d1 100644 --- a/tests/test_native_memory.py +++ b/tests/test_native_memory.py @@ -30,8 +30,12 @@ class ReleaseFreeMemoryTests(unittest.TestCase): def test_musl_does_nothing(self): with ( mock.patch.object(sys, "platform", "linux"), + # Windows has no os.confstr: this test fakes Linux there too. mock.patch.object( - native_memory.os, "confstr", side_effect=ValueError("unknown name") + native_memory.os, + "confstr", + side_effect=ValueError("unknown name"), + create=True, ), mock.patch.object(native_memory.ctypes, "CDLL") as cdll, ):