Change assertTrue(isinstance()) by optimal assert
assertTrue(isinstance(A, B)) or assertEqual(type(A), B) in tests should be replaced by assertIsInstance(A, B) provided by testtools. I have searched all the tests, there is only one wrong usage. Change-Id: Ib1db1a2dca7b5d8cbfe823973e4b571d0f0925c5 Closes-bug: #1268480
This commit is contained in:
parent
a9dee7948d
commit
ab5c5b5d7c
|
@ -26,4 +26,4 @@ class TestHTTPExceptions(testtools.TestCase):
|
|||
def test_from_response(self):
|
||||
"""exc.from_response should return instance of an HTTP exception."""
|
||||
out = exc.from_response(FakeResponse(400))
|
||||
self.assertTrue(isinstance(out, exc.HTTPBadRequest))
|
||||
self.assertIsInstance(out, exc.HTTPBadRequest)
|
||||
|
|
Loading…
Reference in New Issue