Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/python/test_list_all_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
7 changes: 6 additions & 1 deletion tests/python/test_target_py311_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down
Loading