test_init_is_imported_lazily_inside_main

Tests › tests/test_init.py

passed Passed in the packaged run.

What this test is for

Why it exists

`init` must stay runnable on an install missing the pipeline's heavier optional dependencies — it is the command that DIAGNOSES a broken install, so it cannot be the command that needs a whole one to start.

Verifies REQ-DDB-CLI-002

Given

  1. source = inspect.getsource(cli.main)
→

When

  1. —
→

Then

  1. ✓ source contains "from .init_command import"
  2. ✓ inspect.getsource(cli).split("def main(")[0] does not contain "from .init_command import"

tests/test_init.py:1315 · its file's page

What it checks (2)

  1. assert "from .init_command import" in source not attributed
  2. assert "from .init_command import" not in inspect.getsource(cli).split("def main(")[0] not attributed

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.

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-CLI-002catalogunknown