test_an_index_without_the_table_still_resolves

Tests › tests/test_test_scope.py

passed Passed in the packaged run.

What this test is for

Why it exists

FORWARD COMPATIBILITY IS THE POINT. Every index built before this stage has no `test_scope` table, and the query layer must not raise on one — a missing table is missing knowledge, not a reason to refuse an answer. The old ordering is asserted explicitly (the helper wins) so this test says WHICH behaviour the fallback is, rather than merely that it does not crash.

Given

  1. conn = _fixture(tmp_path, mark=False)
→

When

  1. try: assert not _common.table_exists(conn, "test_scope") got = _common.resolve_rowid(conn, "run_turn") rows = _common.function_candidates(conn, "run_turn") finally: conn.close()
→

Then

  1. ✓ got equals HELPER
  2. ✓ len(rows) equals 2

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

Look up one name: everything the index holds about it · 6 of 226 steps

… 45 earlier steps

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesdossier46. _ambiguity_counts → table_exists46table_exists47. _ambiguity_counts → function_candidates47function_candidates48. function_candidates → table_exists48table_exists▶ test enters49–51. function_candidates → _test_scope_term49_test_scope_term +2 more52–53. matching_identity → qualified_name_of52qualified_name_of +1 more

… 155 steps between

callercallercallercallerclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyother filesother filesother filesother filesloop (line 558)looploop (line 570)loopopt (line 239)optopt (line 285)optdossier209. chain_trace → _expand_neighbor209_expand_neighbor210. _expand_neighbor → resolve_rowid210resolve_rowid211. resolve_rowid → table_exists211table_exists▶ test enters212. resolve_rowid → function_candidates212function_candidates213. resolve_rowid → _test_scope_term213_test_scope_term214. _expand_neighbor → _make_node214_make_node215. subject_payload → _flatten_subject215_flatten_subject

… 11 later steps

1 more

tests/test_test_scope.py:185 · its file's page

What it checks (3)

  1. assert not _common.table_exists(conn, "test_scope") observes table_exists
  2. assert got == HELPER, ( "without the table the resolver must fall back to the in-place ordering, which picks " "the helper here — if this changed, the fallback is not the old behaviour" ) observes resolve_rowid via got
  3. assert len(rows) == 2, "candidates must still list every meaning" observes function_candidates via rows

Where the product reaches it

  • dossier → identity_rowids → function_candidates (flow)
  • dossier → _chain_for → chain_trace → _expand_neighbor → resolve_rowid (flow)
  • dossier → identity_rowids → function_candidates → table_exists (flow)

Call flow

test_an_index_without_the_table_still_resolves→_fixture→table_exists→resolve_rowid→function_candidates

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

test_an_index_without_the_table_still_resolves · 3 checkstable_existsREQ-DDB-QUERY-003 · measuredresolve_rowidREQ-DDB-QUERY-010 · measured
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.