import pytest from sqlalchemy import inspect from sqlalchemy.ext.asyncio import AsyncEngine pytestmark = [pytest.mark.integration, pytest.mark.postgres, pytest.mark.asyncio] EXPECTED_TABLES = { "tenants", "api_keys", "source_files", "ingestion_jobs", "ingestion_job_events", "alembic_version", } async def test_migrations_create_schema_from_empty_database(postgres_engine: AsyncEngine) -> None: async with postgres_engine.connect() as connection: table_names = await connection.run_sync( lambda sync_conn: inspect(sync_conn).get_table_names() ) assert EXPECTED_TABLES.issubset(set(table_names))