test_a_draft_with_no_candidates_states_nothing

Tests › tests/test_propose.py

passed Passed in the packaged run.

What this test is for

Why it exists

`{}` is a RESULT — no candidate survived the dry run — and it must not read as a failure, because a repository that needs no declaration is the correct negative this whole feature has to preserve. An exception here would make "nothing to declare" indistinguishable from "the proposer broke".

Given

  1. root = tmp_path / "bare"
  2. (root / "src").mkdir(parents=True)
  3. (root / "src" / "main.c").write_text("int main(void) { return 0; }\n", encoding="utf-8")
→

When

  1. proposal = propose(root, None)
  2. marked_lines(proposal.yaml_text)
  3. statement_from_draft(proposal.yaml_text)
→

Then

  1. ✓ marked_lines(proposal.yaml_text) equals []
  2. ✓ statement_from_draft(proposal.yaml_text) equals {}

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.

clew — `main` (clew/cli.py) · 89 of 400 steps

… 3 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesalt (line 1171)altopt (line 485)optmain4–5. propose_main → _refusal4_refusal +1 more6. propose → db_status_summary6db_status_summary▶ test enters7–10. db_status_summary → index_defect7index_defect +3 more11. propose → build_context11build_context12. build_context → derive_scope12derive_scope13. derive_scope → _declared_index_scope13_declared_index_scope14. _declared_index_scope → load_declaration_located14load_declaration_located15. load_declaration_located → _read_mapping15_read_mapping16. _read_mapping → _parsed_declaration16_parsed_declaration17. load_declaration_located → _checked_sections17_checked_sections

… 26 steps between

command-line usercommand-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyother filesother filesother filesother filesother filesopt (line 696)opttry (line 1003)tryopt (line 847)optloop (line 746)looploop (line 1055)loopopt (line 1075)optopt (line 385)optloop (line 239)looploop (line 268)loopopt (line 270)optopt (line 168)optmain44. _declared_index_scope → _existing_paths44_existing_paths45. derive_scope → whole_repo_scope45whole_repo_scope46. whole_repo_scope → _gitignored_paths46_gitignored_paths47. _gitignored_paths → git_argv47git_argv48–49. git_argv → _no_ext_diff48_no_ext_diff +1 more50. _gitignored_paths → git_env50git_env51. whole_repo_scope → list51list52–56. whole_repo_scope → nested_repo_roots52nested_repo_roots +4 more57. nested_repo_roots → _nested_repos_under57_nested_repos_under58. whole_repo_scope → _gitignored_paths58_gitignored_paths59–60. whole_repo_scope → _pruned_dirs59_pruned_dirs +1 more61. _pruned_dirs → _skip_dir61_skip_dir62–64. _pruned_dirs → _descendable62_descendable +2 more65–68. whole_repo_scope → _declaration_note65_declaration_note +3 more69. derive_scope → whole_repo_scope69whole_repo_scope70–73. build_context → repo_source_files70repo_source_files +3 more74–75. _grammar_available → has_language74has_language +1 more76. _ts_language_for → _try_import_ts_module76_try_import_ts_module77–85. build_context → scope_membership77scope_membership +8 more86–88. _ast_parse_one_file → _disambiguate_header86_disambiguate_header +2 more89. scan_repo → _absorb_file89_absorb_file90. _absorb_file → definition_record90definition_record91. definition_record → _signature91_signature92–93. _signature → _macro_signature92_macro_signature +1 more

… 2 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyloop (line 361)loopmain96–97. _macro_body → text_of96text_of +1 more98–104. _signature → _function_signature98_function_signature +6 more105. definition_record → _forward_calls105_forward_calls106–107. _forward_calls → _forward_call106_forward_call +1 more

… 2 steps between

command-line usercommand-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyother filesother filesother filesother filesother filesloop (line 268)loopelif (line 274)elifloop (line 369)loopmain110. _absorb_file → _accessor_site110_accessor_site111. _accessor_site → callee_name111callee_name112–113. build_context → load_declaration112load_declaration +1 more114. propose → _sections114_sections▶ test enters115–117. _sections → _blocking115_blocking +2 more118. _blocking → is_derived118is_derived119–127. _sections → _blocked_section119_blocked_section +8 more128. candidate_dirs → 128… 1 call not run129–130. report_not_indexed → _dir_lines129_dir_lines +1 more131. propose → scope_summary131scope_summary132. scope_summary → is_derived132is_derived133. scope_summary → ast_readable_in_scope133ast_readable_in_scope134–147. propose → render_declaration134render_declaration +13 more148. _rejections → _wrap148_wrap149–150. _section_block → _notes149_notes +1 more151–152. propose_main → _resolve_db151_resolve_db +1 more

… 248 later steps

4 more

tests/test_propose.py:570 · its file's page

What it checks (2)

  1. assert marked_lines(proposal.yaml_text) == [] observes marked_lines
  2. assert statement_from_draft(proposal.yaml_text) == {} observes statement_from_draft

Where the product reaches it

  • main → propose_main → propose (flow)

Call flow

test_a_draft_with_no_candidates_states_nothing→propose→marked_lines→statement_from_draft

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_a_draft_with_no_candidates_states_nothing · 2 checksproposeREQ-DDB-CONFIG-001 · measuredstatement_from_draftREQ-DDB-CONFIG-008 · measuredpropose… 6 calls …_validate_nodeREQ-DDB-GUARD-012 · inferredproposedb_status_summaryread_build_signatureREQ-DDB-PIPE-005 · inferredpropose… 3 calls …_parseable_fileREQ-DDB-PIPE-011 · measuredpropose… 4 calls …has_languageREQ-DDB-PIPE-012 · inferredpropose… 6 calls …allREQ-DDB-WIKI-054 · inferred
Also reaches 7 requirements

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