From b3a56b35640b0cfceeeb97c885318a3aae7f7b22 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 10 Aug 2021 17:42:47 +0100 Subject: Don't rely on implicit autocommit Resolve the following RemovedIn20Warning warning: The current statement is being autocommitted using implicit autocommit, which will be removed in SQLAlchemy 2.0. Use the .begin() method of Engine or Connection in order to use an explicit transaction for DML and DDL statements. Change-Id: Ib789cd4d11a3d5dd01fcdb99822025b11bbc234e Signed-off-by: Stephen Finucane --- oslo_db/tests/fixtures.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'oslo_db/tests/fixtures.py') diff --git a/oslo_db/tests/fixtures.py b/oslo_db/tests/fixtures.py index 521639c..502719b 100644 --- a/oslo_db/tests/fixtures.py +++ b/oslo_db/tests/fixtures.py @@ -47,11 +47,6 @@ class WarningsFixture(fixtures.Fixture): message=r'The Session.begin.subtransactions flag is deprecated .*', category=sqla_exc.SADeprecationWarning) - warnings.filterwarnings( - 'once', - message=r'The current statement is being autocommitted .*', - category=sqla_exc.SADeprecationWarning) - warnings.filterwarnings( 'once', message=r'Calling \.begin\(\) when a transaction is already .*', @@ -68,6 +63,12 @@ class WarningsFixture(fixtures.Fixture): module='migrate', category=sqla_exc.SADeprecationWarning) + warnings.filterwarnings( + 'once', + message=r'The current statement is being autocommitted .*', + module='migrate', + category=sqla_exc.SADeprecationWarning) + warnings.filterwarnings( 'ignore', message=r'The Engine.execute\(\) method is considered legacy .*', -- cgit v1.2.1