from pathlib import Path def test_all_phase_migrations_exist(): names={p.stem for p in (Path(__file__).parents[2]/"alembic"/"versions").glob("*.py")} assert {"0001_initial","0002_phase_141_psp","0003_phase_142_merchant","0004_phase_143_requests","0005_phase_144_callbacks","0006_phase_145_ledger"}<=names