Exempt lifecycle and construction methods from test gaps (part of #850) - #854
Merged
1 commit merged intoAug 19, 2026
Merged
Conversation
setUp, tearDown, constructors and their xUnit/unittest variants are exercised implicitly by every test that touches their class. Listing them as test gaps inflates the gap count and pushes noise into the Untested summary, which erodes trust in the panel for real gaps. Partial fix; the container-resolution linkage itself is tracked in issue 850 and in issue 851. Part of tirth8205#850
asemraza
force-pushed
the
fix/test-gap-lifecycle-noise
branch
from
August 13, 2026 18:11
7b10045 to
fd001d7
Compare
This was referenced Aug 19, 2026
bebc646
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.
Addresses suggestion 1 of #850 (the noise part). The container-resolution linkage remains open there and in #851.
Problem
analyze_changeslistssetUp,tearDown,__constructand friends as test gaps. These are exercised implicitly by every test touching their class, so they inflate the gap count and theUntested:summary line. In the report that motivated #850, 5 of the 6 gaps on a 2-file diff were lifecycle noise.Change
A module-level
_TEST_GAP_EXEMPT_NAMESfrozenset (PHPUnit/xUnit and Python unittest lifecycle names plus constructors) checked in the test-gap loop. Deliberately name-based and conservative: migrationup/downare NOT excluded here because bare names are too generic to exempt safely; ignore patterns handle migration dirs better.Test
New test asserts lifecycle names and constructors stay out of
test_gapswhile a real uncovered method still appears. Full suite 2,399 passed, ruff and mypy clean.