summaryrefslogtreecommitdiff
path: root/oslo_db/tests
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2021-07-19 11:36:01 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-08-10 17:37:45 +0100
commite1039e0849890c6bd10516004c6dab89db1c9111 (patch)
treed5150380dd8ce38e4bc6c9d2233dd37ada9611f1 /oslo_db/tests
parent62d77fc6df9bf27a334613d42a2ffa14c9711928 (diff)
downloadoslo-db-e1039e0849890c6bd10516004c6dab89db1c9111.tar.gz
Don't pass kwargs to connection.execute()
Resolve the following RemovedIn20Warning warning: The connection.execute() method in SQLAlchemy 2.0 will accept parameters as a single dictionary or a single sequence of dictionaries only. Parameters passed as keyword arguments, tuples or positionally oriented dictionaries and/or tuples will no longer be accepted. Change-Id: I44675fce86337696b6494abc03e8058af32686c6 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'oslo_db/tests')
-rw-r--r--oslo_db/tests/fixtures.py5
-rw-r--r--oslo_db/tests/sqlalchemy/test_sqlalchemy.py3
2 files changed, 1 insertions, 7 deletions
diff --git a/oslo_db/tests/fixtures.py b/oslo_db/tests/fixtures.py
index 561ebc5..ccecccd 100644
--- a/oslo_db/tests/fixtures.py
+++ b/oslo_db/tests/fixtures.py
@@ -54,11 +54,6 @@ class WarningsFixture(fixtures.Fixture):
warnings.filterwarnings(
'once',
- message=r'The connection.execute\(\) method in SQLAlchemy 2.0 .*',
- category=sqla_exc.SADeprecationWarning)
-
- warnings.filterwarnings(
- 'once',
message=r'Calling the mapper\(\) function directly outside .*',
category=sqla_exc.SADeprecationWarning)
diff --git a/oslo_db/tests/sqlalchemy/test_sqlalchemy.py b/oslo_db/tests/sqlalchemy/test_sqlalchemy.py
index 003a49a..45539c5 100644
--- a/oslo_db/tests/sqlalchemy/test_sqlalchemy.py
+++ b/oslo_db/tests/sqlalchemy/test_sqlalchemy.py
@@ -324,8 +324,7 @@ class MySQLModeTestCase(db_test_base._MySQLOpportunisticTestCase):
def _test_string_too_long(self, value):
with self.connection.begin():
- self.connection.execute(self.test_table.insert(),
- bar=value)
+ self.connection.execute(self.test_table.insert(), {'bar': value})
result = self.connection.execute(self.test_table.select())
return result.fetchone().bar