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.
This commit is contained in:
Vito Sansevero
2026-10-31 20:09:07 -07:00
parent 981639740b
commit c14e1af87f
+5 -1
View File
@@ -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,
):