Found (multi-project validation, 2026-06-03)
Running falsegreen against popular Python projects (>200 stars, >=500 tests), C7
fired HIGH on equality-reflexivity tests:
- aiohttp/tests/test_web_response.py:89
assert resp1 == resp1 (next line: assert not resp1 == resp2)
- aiohttp/tests/test_web_request.py:1180
assert req1 == req1 (near assert req1 != req2)
- aiohttp/tests/test_web_app.py:198
Why it is a false positive
assert x == x looks like a tautology, but when the test also asserts x != y or
not x == y on the same object, it is deliberately exercising the __eq__
implementation (reflexivity + inequality). That is a legitimate equality test, not a
self-compare smell. C7 is HIGH, so it blocks the commit: worst kind of false positive.
Fix
In assert_self_compare, do not flag a == self-compare as C7 when the same test
function also compares the same object with != or not == (the equality-semantics
pattern). A lone assert x == x with no inequality check stays flagged.
Regression: fires-on-bad (lone assert x == x) + stays-clean (assert a == a with a
sibling assert a != b). Re-scan aiohttp to confirm 0 high from this.
Evidence detail: .handoff/research/VALIDATION-python-scanner.md (FP-1).
Found (multi-project validation, 2026-06-03)
Running falsegreen against popular Python projects (>200 stars, >=500 tests), C7
fired HIGH on equality-reflexivity tests:
assert resp1 == resp1(next line:assert not resp1 == resp2)assert req1 == req1(nearassert req1 != req2)Why it is a false positive
assert x == xlooks like a tautology, but when the test also assertsx != yornot x == yon the same object, it is deliberately exercising the__eq__implementation (reflexivity + inequality). That is a legitimate equality test, not a
self-compare smell. C7 is HIGH, so it blocks the commit: worst kind of false positive.
Fix
In
assert_self_compare, do not flag a==self-compare as C7 when the same testfunction also compares the same object with
!=ornot ==(the equality-semanticspattern). A lone
assert x == xwith no inequality check stays flagged.Regression: fires-on-bad (lone
assert x == x) + stays-clean (assert a == awith asibling
assert a != b). Re-scan aiohttp to confirm 0 high from this.Evidence detail: .handoff/research/VALIDATION-python-scanner.md (FP-1).