Option C Tools
Loading...
Searching...
No Matches
tests_core.test_diagnostics_stub Namespace Reference

Functions

 test_dbg_importable_and_callable ()
 test_dbg_matches_oc_diagnostics_when_available ()
 test_dbg_fallback_when_oc_diagnostics_missing (monkeypatch)

Detailed Description

Purpose
-------
OI-525 regression tests — ``oct.core.diagnostics`` must provide a single
``_dbg`` entry point that re-binds ``oc_diagnostics._dbg`` when available
and falls back to a silent no-op stub otherwise. This eliminates the
duplicated per-module try/except that previously existed in every
``oct/git/*.py`` file.

Responsibilities
----------------
- Importing ``_dbg`` from ``oct.core.diagnostics`` never raises.
- The resolved ``_dbg`` is callable with ``(domain, func, msg, level)``
  and arbitrary kwargs, and returns ``None``.
- When ``oc_diagnostics`` is importable, ``_dbg`` is the real callable
  (``oc_diagnostics._dbg``) or a trivial bind of it — not a no-op shim.
- When ``oc_diagnostics`` is unavailable, a re-evaluated module exposes
  a no-op fallback.

Diagnostics
-----------
Domain: CORE-TESTS
Levels:
    L2 — test lifecycle
    L3 — assertion details
    L4 — deep tracing

Contracts
---------
- Signature must match ``oc_diagnostics._dbg`` so callers can switch
  transparently.

Function Documentation

◆ test_dbg_fallback_when_oc_diagnostics_missing()

tests_core.test_diagnostics_stub.test_dbg_fallback_when_oc_diagnostics_missing ( monkeypatch)

Definition at line 67 of file test_diagnostics_stub.py.

◆ test_dbg_importable_and_callable()

tests_core.test_diagnostics_stub.test_dbg_importable_and_callable ( )

Definition at line 44 of file test_diagnostics_stub.py.

◆ test_dbg_matches_oc_diagnostics_when_available()

tests_core.test_diagnostics_stub.test_dbg_matches_oc_diagnostics_when_available ( )

Definition at line 53 of file test_diagnostics_stub.py.