diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08aef91b..9b908c6d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: - id: flake8 name: flake8 additional_dependencies: - - hacking>=3.0.1,<3.1.0 + - hacking>=6.1.0,<6.2.0 language: python entry: flake8 files: '^.*\.py$' diff --git a/oslo_db/tests/sqlalchemy/test_sqlalchemy.py b/oslo_db/tests/sqlalchemy/test_sqlalchemy.py index dc4e743c..790e3255 100644 --- a/oslo_db/tests/sqlalchemy/test_sqlalchemy.py +++ b/oslo_db/tests/sqlalchemy/test_sqlalchemy.py @@ -903,8 +903,8 @@ class MySQLConnectPingListenerTest(db_test_base._MySQLOpportunisticTestCase): def test__connect_ping_listener(self): for idx in range(2): with self.engine.begin() as conn: - self.assertTrue(isinstance(conn._transaction, - base_engine.RootTransaction)) + self.assertIsInstance(conn._transaction, + base_engine.RootTransaction) # TODO(ralonsoh): drop this check once SQLAlchemy minimum # version is 2.0. if compat.sqla_2: @@ -912,5 +912,5 @@ class MySQLConnectPingListenerTest(db_test_base._MySQLOpportunisticTestCase): self.assertIsNone(conn._transaction) else: engines._connect_ping_listener(conn, False) - self.assertTrue(isinstance(conn._transaction, - base_engine.RootTransaction)) + self.assertIsInstance(conn._transaction, + base_engine.RootTransaction)