From ab5c5b5d7c214b17b48add9caeaa36a81e3886f5 Mon Sep 17 00:00:00 2001 From: wanghong Date: Thu, 6 Mar 2014 16:18:39 +0800 Subject: [PATCH] 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 --- tests/test_exc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_exc.py b/tests/test_exc.py index 77457cee..d5105bcb 100644 --- a/tests/test_exc.py +++ b/tests/test_exc.py @@ -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)