diff --git a/tests/notebooks/test_code_families_nb.py b/tests/notebooks/test_code_families_nb.py index 4cbfa61..f995711 100644 --- a/tests/notebooks/test_code_families_nb.py +++ b/tests/notebooks/test_code_families_nb.py @@ -8,8 +8,17 @@ import re from pathlib import Path import marimo as mo +import pytest NB = Path(__file__).resolve().parents[2] / "notebooks" / "code_families.py" +_ROOT = Path(__file__).resolve().parents[2] +#: The two live tests run the whole notebook against the real replica and +#: bibliography (data symlinks in a checkout); CI has neither, so they skip +#: there — the headless-degrade test above covers the no-data path. +_HAS_DATA = (_ROOT / "data" / "replica" / "aco.ro.duckdb").exists() and ( + _ROOT / "data" / "bib.sqlite" +).exists() +_live = pytest.mark.skipif(not _HAS_DATA, reason="needs the live replica and bib") def _load(): @@ -65,6 +74,7 @@ def _tables_in(obj): return found +@_live def test_section5_tolerates_missing_llm_db_password(monkeypatch): """Section 5's pgvector chunk-count lookup must degrade to a note, never raise, when LLM_DB_PASSWORD is unset — the bib item-tag counts @@ -92,6 +102,7 @@ def test_section5_tolerates_missing_llm_db_password(monkeypatch): assert rows.get("family:CCM", 0) > 0 +@_live def test_section_7b_tolerates_missing_llm_deps(monkeypatch): """#720: the notebooks container installs the workspace without the ``llm`` extra. When ``llm.lineage`` cannot be imported, section 7b