Re: [sqlalchemy] Must close connection before drop_all?

2018-10-30 Thread Mike Bayer
On Tue, Oct 30, 2018 at 12:59 PM T Johnson wrote: > > Hi, I am writing some unit tests, and I am getting blocked waiting for a > metadata lock (in MySQL) due to an open connection. > > The code is roughly: > > metadata.drop_all(engine) > metadata.create_all(engine) > conn = engine.connect() > sql

[sqlalchemy] Must close connection before drop_all?

2018-10-30 Thread T Johnson
Hi, I am writing some unit tests, and I am getting blocked waiting for a metadata lock (in MySQL) due to an open connection. The code is roughly: metadata.drop_all(engine) metadata.create_all(engine) conn = engine.connect() sql = sa.text('select * from table') rows = conn.execute(sql).fetchall()