diff --git a/master/buildbot/test/unit/scripts/test_copydb.py b/master/buildbot/test/unit/scripts/test_copydb.py index 8b86b678e19..a26bdff0325 100644 --- a/master/buildbot/test/unit/scripts/test_copydb.py +++ b/master/buildbot/test/unit/scripts/test_copydb.py @@ -161,8 +161,8 @@ def resolve_db_url(self): def drop_database_tables(self, db_url): engine = enginestrategy.create_engine(db_url, basedir='basedir') - conn = engine.connect() - db.thd_clean_database(conn) + with engine.connect() as conn: + db.thd_clean_database(conn) @async_to_deferred async def test_full(self):