diff --git a/tests/python/test_list_all_modules.py b/tests/python/test_list_all_modules.py index 2cbdb5e..ab78d56 100644 --- a/tests/python/test_list_all_modules.py +++ b/tests/python/test_list_all_modules.py @@ -267,7 +267,13 @@ def test_builtins_still_discoverable_under_only_c(self): # Regression guard: a builtin IS a C module (compiled into the interpreter) but has no # filename, so routing the seed through the file-based only-c check would drop every # builtin from --only-c runs. - self.assertIn("math", self._discovered(set(), only_c=True)) + # + # Which modules are built in is a property of the BUILD, not of fusil: `math` is + # compiled into the interpreters used here but is a shared extension on the + # python.org builds CI installs, where naming it made this fail on every run since + # 2026-08-19. Assert the invariant over whatever this interpreter actually has. + expected = set(sys.builtin_module_names) - {"__main__"} + self.assertEqual(self._discovered(set(), only_c=True) & expected, expected) def test_dunder_main_still_excluded(self): self.assertNotIn("__main__", self._discovered(set())) diff --git a/tests/python/test_target_py311_compat.py b/tests/python/test_target_py311_compat.py index 25a319d..00d98ea 100644 --- a/tests/python/test_target_py311_compat.py +++ b/tests/python/test_target_py311_compat.py @@ -38,9 +38,14 @@ def test_tricky_objects_runs_without_types_CapsuleType(self): # killing the session during the prelude -- before a single call is fuzzed. source = (SAMPLES / "tricky_objects.py").read_text() + # `__getattr__` must be skipped as well, not just CapsuleType. CPython 3.13 defines + # CapsuleType LAZILY through a module-level __getattr__ (PEP 562); copying that into + # the shim resolves the attribute straight back to the real module and the shim stops + # shimming. 3.14 defines it eagerly via _types, which is why this passed locally and + # failed on CI's 3.13 job on every run since 2026-08-19. shim = types.ModuleType("types") for name in dir(types): - if name != "CapsuleType": + if name not in ("CapsuleType", "__getattr__"): setattr(shim, name, getattr(types, name)) self.assertFalse(hasattr(shim, "CapsuleType"))