|
Option C Tools
|
Functions | |
| LinterContext | _make_ctx (Path tmp_path, handle) |
| test_no_module_level_log_handle () | |
| test_log_writes_through_ctx_handle (Path tmp_path) | |
| test_log_is_silent_without_ctx_or_handle (Path tmp_path) | |
| test_two_contexts_isolate_handles (Path tmp_path) | |
Purpose
-------
OI-513 regression coverage — ``LOG_HANDLE`` must not exist as a
module-level global on :mod:`oct.linter.oct_lint`. All log state lives
on :class:`LinterContext` so that concurrent linter invocations (MCP,
parallel ``--jobs``, health dashboard) never share mutable state.
Responsibilities
----------------
- Verify ``oct.linter.oct_lint`` exposes no ``LOG_HANDLE`` attribute.
- Verify ``log()`` writes through ``ctx.log_handle`` only.
- Verify two concurrent contexts never cross-pollute handles.
Diagnostics
-----------
Domain: LINTER-TESTS
Levels:
L2 — test lifecycle
L3 — assertion details
L4 — deep tracing
Contracts
---------
- ``oct.linter.oct_lint`` exposes no ``LOG_HANDLE`` attribute.
- :func:`log` writes through ``ctx.log_handle`` only; silent when None.
- Two contexts in flight never cross-pollute handles.
|
protected |
Definition at line 44 of file test_log_handle_encapsulation.py.
| tests_linter.test_log_handle_encapsulation.test_log_is_silent_without_ctx_or_handle | ( | Path | tmp_path | ) |
OI-513: ``log()`` is a no-op when ctx is None or handle is None.
Definition at line 69 of file test_log_handle_encapsulation.py.
| tests_linter.test_log_handle_encapsulation.test_log_writes_through_ctx_handle | ( | Path | tmp_path | ) |
OI-513: ``log()`` routes through ``ctx.log_handle``.
Definition at line 61 of file test_log_handle_encapsulation.py.
| tests_linter.test_log_handle_encapsulation.test_no_module_level_log_handle | ( | ) |
OI-513: the deprecated module global is gone.
Definition at line 56 of file test_log_handle_encapsulation.py.
| tests_linter.test_log_handle_encapsulation.test_two_contexts_isolate_handles | ( | Path | tmp_path | ) |
OI-513: parallel runs do not share a global handle.
Definition at line 78 of file test_log_handle_encapsulation.py.