Code review comment for lp:~abompard/mailman/failing-test

Revision history for this message
Aurélien Bompard (abompard) wrote :

> * After calling setup_database(), why would you expect that alembic.command.upgrade was not called?

Because when there is no existing database, I'm not using alembic.command.upgrade, I'm creating all tables in SQLAlchemy with Metadata.create_all and them I'm stamping the schema at Alembic's latest version with alembic.command.stamp. So I'm checking that I'm not going through a different code path.

> * After calling setup_database(), would you expect alembic_version table to exist, or would it only exist after the md.reflect() call?

The table is created by the Alembic stamp command, but it's not in Mailman's metadata (we have no model for it since we don't use it), so I have to detect its presence using md.reflect().

Does this answer your questions?

« Back to merge proposal