osint-dashboard/news/summerizer/tests/conftest.py

12 lines
322 B
Python
Raw Normal View History

"""Keep summarizer unit tests importable without Postgres drivers."""
from __future__ import annotations
import sys
from types import ModuleType
if "psycopg2" not in sys.modules:
fake = ModuleType("psycopg2")
fake.connect = lambda **kwargs: None # type: ignore[attr-defined]
sys.modules["psycopg2"] = fake