test_explicit_flag_wins_over_the_declaration

Tests › tests/test_declaration.py

passed Passed in the packaged run.

What this test is for

Why it exists

The file is the repo's standing statement; a flag is a deliberate one-off override, so the flag takes precedence.

Given

  1. decl = {SECTION_SHARED_KEY: {"writers": [{"name_prefix": "FROM_DECL_"}]}}
  2. explicit = tmp_path / "patterns.yaml"
  3. explicit.write_text("writers: []\n", encoding="utf-8")
→

When

  1. _declared_or_flag(str(explicit), decl, SECTION_SHARED_KEY)
  2. _declared_or_flag(None, decl, SECTION_SHARED_KEY)
  3. _declared_or_flag(None, {}, SECTION_SHARED_KEY)
→

Then

  1. ✓ _declared_or_flag(str(explicit), decl, SECTION_SHARED_KEY) equals explicit.resolve()
  2. ✓ _declared_or_flag(None, decl, SECTION_SHARED_KEY) equals decl[SECTION_SHARED_KEY]
  3. ✓ _declared_or_flag(None, {}, SECTION_SHARED_KEY) is None

tests/test_declaration.py:105 · its file's page

What it checks (3)

  1. assert _declared_or_flag(str(explicit), decl, SECTION_SHARED_KEY) == explicit.resolve() observes _declared_or_flag
  2. assert _declared_or_flag(None, decl, SECTION_SHARED_KEY) == decl[SECTION_SHARED_KEY] observes _declared_or_flag
  3. assert _declared_or_flag(None, {}, SECTION_SHARED_KEY) is None observes _declared_or_flag

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_explicit_flag_wins_over_the_declaration→_declared_or_flag

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.

Also reaches 1 requirement

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