summaryrefslogtreecommitdiff
path: root/oslo_db
diff options
context:
space:
mode:
authorTony Xu <hhktony@gmail.com>2016-10-25 10:14:38 +0800
committerTony Xu <hhktony@gmail.com>2016-10-25 10:14:38 +0800
commita65a42b5c35b47992b23ddfb3261bc744f98c261 (patch)
treefc33f071aa97a0f2456d1aef74525aaa684fd273 /oslo_db
parent21a5c42f7ac9b3bfa97afdd7e9893f5414d39cd4 (diff)
downloadoslo-db-a65a42b5c35b47992b23ddfb3261bc744f98c261.tar.gz
Change assertTrue(isinstance()) by optimal assert
Use assertIsInstance() instead of assertTrue(isinstance()) Change-Id: I47c75200a8c628779a96563c3982472743cbf4f9
Diffstat (limited to 'oslo_db')
-rw-r--r--oslo_db/tests/sqlalchemy/test_utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/oslo_db/tests/sqlalchemy/test_utils.py b/oslo_db/tests/sqlalchemy/test_utils.py
index 1471ff1..a1b8d1d 100644
--- a/oslo_db/tests/sqlalchemy/test_utils.py
+++ b/oslo_db/tests/sqlalchemy/test_utils.py
@@ -593,7 +593,7 @@ class TestMigrationUtils(db_test_base.DbTestCase):
utils.change_deleted_column_type_to_id_type(self.engine, table_name)
table = utils.get_table(self.engine, table_name)
- self.assertTrue(isinstance(table.c.deleted.type, Integer))
+ self.assertIsInstance(table.c.deleted.type, Integer)
def test_change_deleted_column_type_to_id_type_string(self):
table_name = 'abc'
@@ -604,7 +604,7 @@ class TestMigrationUtils(db_test_base.DbTestCase):
utils.change_deleted_column_type_to_id_type(self.engine, table_name)
table = utils.get_table(self.engine, table_name)
- self.assertTrue(isinstance(table.c.deleted.type, String))
+ self.assertIsInstance(table.c.deleted.type, String)
@db_test_base.backend_specific('sqlite')
def test_change_deleted_column_type_to_id_type_custom(self):
@@ -627,7 +627,7 @@ class TestMigrationUtils(db_test_base.DbTestCase):
table = utils.get_table(self.engine, table_name)
- self.assertTrue(isinstance(table.c.deleted.type, Integer))
+ self.assertIsInstance(table.c.deleted.type, Integer)
def test_change_deleted_column_type_to_boolean(self):
expected_types = {'mysql': mysql.TINYINT,
@@ -686,8 +686,8 @@ class TestMigrationUtils(db_test_base.DbTestCase):
# but sqlalchemy will set it to NullType. This has
# been fixed upstream in recent SA versions
if SA_VERSION < (0, 9, 0):
- self.assertTrue(isinstance(table.c.foo.type, NullType))
- self.assertTrue(isinstance(table.c.deleted.type, Boolean))
+ self.assertIsInstance(table.c.foo.type, NullType)
+ self.assertIsInstance(table.c.deleted.type, Boolean)
def test_detect_boolean_deleted_constraint_detection(self):
table_name = 'abc'