Merge "Change assertTrue(isinstance()) by optimal assert"

This commit is contained in:
Jenkins 2016-10-11 14:13:08 +00:00 committed by Gerrit Code Review
commit 48be493fe3

View File

@ -109,11 +109,11 @@ class ImportUtilsTest(test_base.BaseTestCase):
def test_import_object(self):
dt = importutils.import_object('datetime.time')
self.assertTrue(isinstance(dt, sys.modules['datetime'].time))
self.assertIsInstance(dt, sys.modules['datetime'].time)
def test_import_object_with_args(self):
dt = importutils.import_object('datetime.datetime', 2012, 4, 5)
self.assertTrue(isinstance(dt, sys.modules['datetime'].datetime))
self.assertIsInstance(dt, sys.modules['datetime'].datetime)
self.assertEqual(dt, datetime.datetime(2012, 4, 5))
def test_try_import(self):