This code did the trick:
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy import create_engine
engine = create_engine('mysql://user:password@localhost/table')
inspector = Inspector.from_engine(engine)
def test_db():
db.create_all()
assert inspector.get_table_names()[0] == 'comments'
db.drop_all()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…