Skip to content

🧪 test: tolerate a preloaded sqlite3 - #894

Merged
gaborbernat merged 1 commit into
mainfrom
fix/lazy-import-preloaded-modules
Oct 28, 2026
Merged

gaborbernat merged 1 commit into
mainfrom
fix/lazy-import-preloaded-modules

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

The FreeBSD run in #864 failed test_lazy_import_skips_asyncio_and_sqlite3 with ['sqlite3']: a site hook in that environment loaded sqlite3 at interpreter start, before filelock was imported. A .pth file that imports sqlite3 reproduces it, and the same preload breaks the missing-sqlite3 checks, because a finder cannot hide a module that is already cached.

The lazy-import check now counts only the modules that importing filelock adds, and the missing-module checks evict a preloaded sqlite3 before installing the finder that hides it. Library behavior is unchanged.

The FreeBSD environment in #864 loads sqlite3 before filelock through a
site hook, so the lazy-import check reported ['sqlite3'] although filelock
never imported it, and the missing-sqlite3 checks could not hide a module
that was already cached.

The lazy-import check now counts only the modules the import adds, and the
missing-module checks evict a preloaded sqlite3 before installing the
finder that hides it.
@gaborbernat gaborbernat added the skip news Internal change; exempt from the news fragment check label Oct 28, 2026
@gaborbernat
gaborbernat merged commit b0f1b73 into main Oct 28, 2026
89 of 93 checks passed
@gaborbernat
gaborbernat deleted the fix/lazy-import-preloaded-modules branch October 28, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news Internal change; exempt from the news fragment check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant