test_console_script_targets_reads_both_table_spellings

Tests › tests/test_python_ast.py

passed Passed in the packaged run.

What this test is for

Why it exists

PEP 621 and poetry are both real, so both tables are read rather than one build backend being assumed.

Given

  1. (tmp_path / "pyproject.toml").write_text( '[project.scripts]\nfoo = "pkg.mod:main"\n[tool.poetry.scripts]\nbar = "pkg.other:run"\n', )
→

When

  1. targets = console_script_targets(tmp_path)
  2. console_script_targets(tmp_path / "nope")
→

Then

  1. ✓ set(targets) equals {"pkg.mod:main", "pkg.other:run"}
  2. ✓ console_script_targets(tmp_path / "nope") 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.

Build this wiki from the index · 4 of 400 steps

… 94 earlier steps

callercallercallercallerother filesother filesother filesother filesloop (line 43)looploop (line 223)looploop (line 224)looploop (line 74)looploop (line 78)loopbuild_wiki95–96. entry_point_flows → _scripts95_scripts +1 more97. console_scripts → _read_toml97_read_toml▶ test enters98–99. _read_toml → require_toml_module98require_toml_module +1 more100. console_scripts → _nested100_nested101. _scripts → _defined101_defined102. entry_point_flows → _mains102_mains

… 298 later steps

1 more

tests/test_python_ast.py:619 · its file's page

What it checks (2)

  1. assert set(targets) == {"pkg.mod:main", "pkg.other:run"} observes console_script_targets via targets
  2. assert console_script_targets(tmp_path / "nope") == [] observes console_script_targets

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_console_script_targets_reads_both_table_spellings→console_script_targets

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_console_script_targets_reads_both_table_spellings · 2 checksconsole_script_targetsREQ-DDB-PIPE-004 · measured
Also reaches 1 requirement

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