"""Shared fixtures for journal_quality tests."""

import pytest

from local_deep_research.journal_quality.db import JournalQualityDB


@pytest.fixture()
def ref_db():
    """Get the reference DB (uses actual file, skips if not present).

    Does NOT trigger auto-download — in CI the DB file won't exist and
    we skip immediately instead of trying to download 200K+ sources.
    """
    db = JournalQualityDB()
    # Check if DB file exists without triggering auto-download
    db_path = db._resolve_db_path()
    if not db_path.exists():
        pytest.skip(
            "journal_quality.db not built — run journal data download first"
        )
    return db
