Files
stack/tests/cli/test_run_exercise.py
kert dbf71a6594 test: 99.93% coverage — Zotero 9 schema fix + 400+ new tests
Fix Zotero table models for Zotero 9:
- Remove stale Annotations/Highlights/Transaction* models
- Add ItemAnnotations, RetractedItems, DeletedCollections,
  DeletedSearches, DbDebug1
- Fix ItemAttachments, Libraries, Users column mismatches

New test files covering all major modules:
- cli/{bib,prisma,rec,zot,mail,run} deep exercising tests
- mail/{droplet,postmark,resend,cloudflare} lifecycle tests
- bib/{iom,oig,pincite,sync,regulations_gov,email_ingest,format,store}
- prisma/{vpn,fetch,export,llm,screen,eligibility,extract,project,ingest,flow}
- aco/lake/{unity,quality,deploy} + api/aco coverage gaps
- zot/{ops,db,extract,duck} + rec/{report,engine,base,pricers}
- pfs/{pipe,rules,eq,files}

Add pytest-xdist for parallel test execution.

Tracks #353
2026-04-18 10:06:47 -04:00

33 lines
873 B
Python

"""Exercise cli/run.py — _make_context paths."""
from __future__ import annotations
from unittest.mock import patch
import typer
from cli.run import _make_context
class TestMakeContext:
@patch("conf.path", return_value="/tmp/test.duckdb")
@patch("conf.cfg")
def test_local(self, mc_cfg, mc_path):
ctx = _make_context("local")
assert ctx is not None
@patch("conf.cfg")
def test_unknown_target(self, mc_cfg):
import pytest
with pytest.raises(typer.Exit):
_make_context("bogus")
@patch("conf.cfg")
def test_catalog_implies_spark(self, mc_cfg):
"""The catalog + spark path needs PySpark — just verify the branch."""
try:
_make_context("spark", catalog_override="my_cat")
except (ImportError, ModuleNotFoundError):
pass # PySpark not installed