tests: cover both directions of the NO_EXTENSIONS import branch#782
Merged
bdraco merged 3 commits intoMay 20, 2026
Conversation
The ``if not NO_EXTENSIONS:`` block in ``frozenlist/__init__.py`` only runs in one direction per process, depending on the value of ``FROZENLIST_NO_EXTENSIONS`` at import time. Each Codecov upload from the CI matrix therefore reports that line as a one-sided partial, and Codecov does not merge the two opposite partials across uploads, so the ``codecov/project/lib`` gate stays stuck at 98.38%. Add two tests that re-import the module under ``monkeypatch`` with the env var both set and unset. Every Codecov upload now hits both branch directions and the gate can reach 100%.
The Sphinx docs build (and ``make spelling``) fails the intersphinx lookup for ``:mod:`frozenlist``` because the project does not document the package itself as a Python domain target. Match the convention used by the other fragments and refer to the module name in plain double-backticks.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #782 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 370 383 +13
Branches 9 9
=========================================
+ Hits 370 383 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bdraco
commented
May 20, 2026
Co-authored-by: J. Nick Koston <nick+github@koston.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What do these changes do?
Add two tests that re-import the package under
monkeypatchwith
FROZENLIST_NO_EXTENSIONSboth set and unset, so everyCodecov upload exercises both directions of the import-time
if not NO_EXTENSIONS:branch infrozenlist/__init__.py.Until now each CI matrix job only ran one direction of that
branch (depending on its
FROZENLIST_NO_EXTENSIONSvalue),so every upload reported the line as a one-sided partial.
Codecov does not merge the two opposite partials across
uploads, which left the
codecov/project/libgate stuck at98.38% (target 100%) on every PR; see #780 for one example.
Are there changes in behavior for the user?
No.
Related issue number
No linked issue; closes the persistent failure of
codecov/project/libon recent PRs (#780, #779, #777, #774,and others).
Checklist
CONTRIBUTORS.txtCHANGESfolderAgent run details (optional, for reviewers)
Local verification, both legs at 100% coverage on
frozenlist/__init__.py:Drafted with Claude Code (Opus 4.7); reviewed by @bdraco.