drop_all() freezes in Flask with SQLAlchemy

Oki, there might be other solutions but for now, after searching the interwebs, I found that the problem disappears if I prepend my code with a myapp.db.session.commit(). I guess, somewhere a transaction was waiting to be committed.

def setUp(self):
    # other stuff...
    myapp.db.session.commit()   #<--- solution!
    myapp.db.drop_all()
    myapp.db.create_all()
    # db creation...

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)