test: fix two stale unit tests failing on main CI#809
Merged
Conversation
- test_batch_upsert_graph_edges_updates_existing asserted a lower re-upsert overwrites confidence, but edge upsert now keeps the max on collision (#807). Seed 0.7, re-upsert 0.5, assert it holds at 0.7. - test_hedged_but_named_body_served_holds_medium stubbed _anchor_symbol_hits with the pre-#796 signature; the real call now passes repo_root= and session_factory=, so the stub raised TypeError under contextlib.suppress and anchoring silently no-op'd. Accept **kwargs in the fake.
|
✅ Health: 7.6 (unchanged) 📋 At a glance 🔎 More signals (2)🔥 Hotspots touched (2)
🔗 Hidden coupling (1 file)
📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-12 11:31 UTC |
RaghavChamadiya
approved these changes
Jul 12, 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.
What
Two unit tests have been failing deterministically on
mainacross Python 3.11/3.12/3.13. Both are stale tests, not source regressions — the underlying behavior changes were intentional; the tests just weren't updated alongside them.1.
test_batch_upsert_graph_edges_updates_existingassert 1.0 == 0.5PR #807 (
fix(graph): keep max confidence on edge upsert) made_update_graph_edgekeepmax(existing, new)confidence on collision, so a real call can't be stamped below the flow-calls floor by a later lower-confidence upsert. The test still asserted that a lower re-upsert (0.5) overwrites the default (1.0).Fix: seed the edge at 0.7, re-upsert at 0.5, and assert confidence holds at 0.7 — directly covering the max-keep contract while still verifying the in-place
imported_names_jsonupdate.2.
test_hedged_but_named_body_served_holds_mediumassert 'low' == 'medium'PR #796 added
repo_root=andsession_factory=keyword args to the_anchor_symbol_hitscall site. The test's_fake_anchorstub only accepted the four positional args, so the real call raisedTypeError— swallowed by thecontextlib.suppress(Exception)around it. Anchoring silently no-op'd,_anchor_symbolswas never attached,served_named_bodystayedFalse, and the hedged answer fell tolowinstead ofmedium.Fix: the fake now accepts
**kwargsso it matches the real signature.Test
Both files pass locally (55 tests):
Test-only change; no product code touched.