test(notebooks): the two live code_families tests skip without the replica and bib (CI has neither) (refs #721)
All checks were successful
CI / lint (push) Successful in 39s
CI / notebooks-smoke (push) Successful in 1m25s
Deploy / notebooks (push) Has been skipped
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Has been skipped
Deploy / api (push) Has been skipped
Deploy / llm (push) Has been skipped
Deploy / mc (push) Has been skipped
Deploy / report (push) Successful in 15s
CI / test (push) Successful in 13m7s

This commit is contained in:
kert
2026-09-11 14:55:45 -04:00
parent 5f446e3804
commit de2a9a7b0d

View File

@@ -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