[FIX] Use SQLAlchemy .is_(False) instead of Python identity check in test result filtering#1043
Merged
canihavesomecoffee merged 1 commit intoCCExtractor:masterfrom Mar 5, 2026
Conversation
Contributor
Author
Local VerificationNote: Full test suite requires MySQL which I don't have locally — CI should cover this. The change is a single-line fix to a well-documented SQLAlchemy anti-pattern ( |
Replace 'RegressionTestOutput.ignore is False' with 'RegressionTestOutput.ignore.is_(False)' in get_test_results(). Python's 'is False' performs an identity check against the False singleton, which always evaluates to False for a SQLAlchemy column attribute. This caused the filter to silently return no results, meaning tests with missing (non-ignored) output files were not flagged as errors. Fixes CCExtractor#1042
8248bcb to
bbae567
Compare
canihavesomecoffee
approved these changes
Mar 5, 2026
|
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.



In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary
Fixes a silent SQLAlchemy filter bug in
get_test_results()(mod_test/controllers.py:102).The Bug
RegressionTestOutput.ignoreis aColumn(Boolean()). Using Python'sis Falseperforms an identity check — "is this column attribute the exact same object asFalse?" — which is alwaysFalse. This means theand_()filter always evaluates tofilter(and_(..., False)), returning no results.Impact
In the "no result files" branch of
get_test_results()(line 98-109), when a regression test has non-ignored output files but the test produced no result files, the broken filter returns nothing. Thelen(outputs) > 0check on line 105 is therefore never true, so the test entry is not flagged as an error — silently appearing as passing.Changes
mod_test/controllers.py:102pycodestyle✅ passesFixes #1042