summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oslo_db/tests/fixtures.py5
-rw-r--r--oslo_db/tests/sqlalchemy/test_exc_filters.py10
2 files changed, 5 insertions, 10 deletions
diff --git a/oslo_db/tests/fixtures.py b/oslo_db/tests/fixtures.py
index 1f240ae..a1b6929 100644
--- a/oslo_db/tests/fixtures.py
+++ b/oslo_db/tests/fixtures.py
@@ -84,11 +84,6 @@ class WarningsFixture(fixtures.Fixture):
warnings.filterwarnings(
'once',
- message=r'Using plain strings to indicate SQL statements .*',
- category=sqla_exc.SADeprecationWarning)
-
- warnings.filterwarnings(
- 'once',
message=r'The current statement is being autocommitted .*',
category=sqla_exc.SADeprecationWarning)
diff --git a/oslo_db/tests/sqlalchemy/test_exc_filters.py b/oslo_db/tests/sqlalchemy/test_exc_filters.py
index bb04986..9075f2a 100644
--- a/oslo_db/tests/sqlalchemy/test_exc_filters.py
+++ b/oslo_db/tests/sqlalchemy/test_exc_filters.py
@@ -679,7 +679,7 @@ class TestExceptionCauseMySQLSavepoint(
with session.begin():
try:
with session.begin_nested():
- session.execute("rollback")
+ session.execute(sql.text("rollback"))
session.add(self.A(id=1))
# outermost is the failed SAVEPOINT rollback
# from the "with session.begin_nested()"
@@ -707,7 +707,7 @@ class TestExceptionCauseMySQLSavepoint(
session.begin()
try:
- session.execute("select 1")
+ session.execute(sql.text("select 1"))
# close underying DB connection
session.connection().connection.connection.close()
@@ -717,7 +717,7 @@ class TestExceptionCauseMySQLSavepoint(
# session.execute("kill connection %s" % conn_id)
# try using it, will raise an error
- session.execute("select 1")
+ session.execute(sql.text("select 1"))
except exception.DBConnectionError:
# issue being tested is that this session.rollback()
# does not itself try to re-connect and raise another
@@ -732,7 +732,7 @@ class TestExceptionCauseMySQLSavepoint(
session.begin()
try:
session.begin_nested()
- session.execute("select 1")
+ session.execute(sql.text("select 1"))
# close underying DB connection
session.connection().connection.connection.close()
@@ -742,7 +742,7 @@ class TestExceptionCauseMySQLSavepoint(
# session.execute("kill connection %s" % conn_id)
# try using it, will raise an error
- session.execute("select 1")
+ session.execute(sql.text("select 1"))
except exception.DBConnectionError:
# issue being tested is that this session.rollback()
# does not itself try to re-connect and raise another