|
Option C Tools
|
Functions | |
| dict | _minimal_report (*, bool venv_active) |
| str | _render (dict report) |
| test_banner_renders_when_venv_inactive () | |
| test_banner_absent_when_venv_active () | |
| test_banner_absent_in_json_output (pytest.CaptureFixture capsys) | |
| test_banner_copy_instructs_venv_creation () | |
Variables | |
| str | _BANNER_TEXT = "WARNING: not running inside a virtual environment." |
Purpose
-------
FS-504 regression coverage — ``oct health`` must surface a prominent
top-of-report banner when the operator runs the dashboard from outside
a virtual environment. The banner is what upgrades "naked Python" from
an easily-missed per-section ``[WARN]`` into something the operator
cannot overlook before reading the rest of the report.
The banner uses ``!`` as the rule character (70 columns) and carries
the literal string "WARNING: not running inside a virtual environment.".
Diagnostics
-----------
Domain: HEALTH-TESTS
Levels:
L2 — test lifecycle
Contracts
---------
- ``venv.active == False`` → banner rendered.
- ``venv.active == True`` → banner absent (per-section [OK] still there).
- Banner never appears in JSON output (machine-readable path unchanged).
|
protected |
Smallest ``report`` dict that satisfies ``_print_terminal_report``.
Definition at line 44 of file test_venv_warning.py.
|
protected |
| tests_health.test_venv_warning.test_banner_absent_in_json_output | ( | pytest.CaptureFixture | capsys | ) |
FS-504: JSON output is machine-readable — never gains a banner.
Definition at line 103 of file test_venv_warning.py.
| tests_health.test_venv_warning.test_banner_absent_when_venv_active | ( | ) |
FS-504: active venv → no banner; [OK] status still visible.
Definition at line 95 of file test_venv_warning.py.
| tests_health.test_venv_warning.test_banner_copy_instructs_venv_creation | ( | ) |
FS-504: banner body mentions the exact ``python -m venv .venv`` remedy.
Definition at line 112 of file test_venv_warning.py.
| tests_health.test_venv_warning.test_banner_renders_when_venv_inactive | ( | ) |
FS-504: banner appears once and lands above the per-section summary.
Definition at line 84 of file test_venv_warning.py.
|
protected |
Definition at line 41 of file test_venv_warning.py.