summaryrefslogtreecommitdiff
path: root/oslo_db/tests/fixtures.py
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2021-08-10 17:42:47 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-08-10 17:42:47 +0100
commitb3a56b35640b0cfceeeb97c885318a3aae7f7b22 (patch)
tree4c48c667276ea65c24aa5d401eedcf71b8890e38 /oslo_db/tests/fixtures.py
parentdf901a1c765c16de77c2f734760e9ecf95483737 (diff)
downloadoslo-db-b3a56b35640b0cfceeeb97c885318a3aae7f7b22.tar.gz
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 <stephenfin@redhat.com>
Diffstat (limited to 'oslo_db/tests/fixtures.py')
-rw-r--r--oslo_db/tests/fixtures.py11
1 files changed, 6 insertions, 5 deletions
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
@@ -49,11 +49,6 @@ class WarningsFixture(fixtures.Fixture):
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 .*',
category=sqla_exc.SADeprecationWarning)
@@ -69,6 +64,12 @@ class WarningsFixture(fixtures.Fixture):
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 .*',
module='migrate',