"""Regression guard: ensure the running app only talks PostgreSQL.""" from app.core.database import engine from app.core.config import settings def test_engine_dialect_is_postgres(): """The SQLAlchemy engine must use the postgresql dialect.""" assert engine.dialect.name == "postgresql", ( f"Expected postgresql dialect, got {engine.dialect.name}. " "Something is reintroducing MariaDB/MySQL — check config.py and requirements.txt." ) def test_database_url_does_not_contain_mysql(): """No DATABASE_URL path should produce a mysql:// URL.""" assert "mysql" not in settings.DATABASE_URL.lower() assert "pymysql" not in settings.DATABASE_URL.lower() def test_pymysql_not_installed(): """pymysql must not be importable — it was removed from requirements.""" import importlib try: importlib.import_module("pymysql") raise AssertionError("pymysql is still installed. Run: pip uninstall pymysql") except ImportError: pass # expected