diff --git a/oslo_db/tests/fixtures.py b/oslo_db/tests/fixtures.py index 1f240ae2..a1b69295 100644 --- a/oslo_db/tests/fixtures.py +++ b/oslo_db/tests/fixtures.py @@ -82,11 +82,6 @@ class WarningsFixture(fixtures.Fixture): message=r'Calling the mapper\(\) function directly outside .*', category=sqla_exc.SADeprecationWarning) - 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 .*', diff --git a/oslo_db/tests/sqlalchemy/test_exc_filters.py b/oslo_db/tests/sqlalchemy/test_exc_filters.py index bb049860..9075f2ad 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