summaryrefslogtreecommitdiff
path: root/oslo_db/tests/fixtures.py
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2021-07-19 11:48:58 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-08-10 17:38:48 +0100
commitdf901a1c765c16de77c2f734760e9ecf95483737 (patch)
treed513efdd21018a0c18a6fa5396af350a2d470761 /oslo_db/tests/fixtures.py
parentecb15c4ac63772e3332ac0f475e852f414ca3bbb (diff)
downloadoslo-db-df901a1c765c16de77c2f734760e9ecf95483737.tar.gz
Replace use of 'Engine.execute()'
Resolve the following RemovedIn20Warning warning: The Engine.execute() method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. Change-Id: I4c47a690a94abcb3b4b6fb087a1bf86c5350b523 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 0168116..521639c 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 Engine.execute\(\) method is considered legacy .*',
- category=sqla_exc.SADeprecationWarning)
-
- warnings.filterwarnings(
- 'once',
message=r'The current statement is being autocommitted .*',
category=sqla_exc.SADeprecationWarning)
@@ -73,4 +68,10 @@ class WarningsFixture(fixtures.Fixture):
module='migrate',
category=sqla_exc.SADeprecationWarning)
+ warnings.filterwarnings(
+ 'ignore',
+ message=r'The Engine.execute\(\) method is considered legacy .*',
+ module='migrate',
+ category=sqla_exc.SADeprecationWarning)
+
self.addCleanup(warnings.resetwarnings)