From f82edf87219bc0b411e702d773e0b764a1d2ce5b Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Mon, 6 Jan 2014 16:06:17 -0600 Subject: Tests use cleanUp rather than tearDown The tests were putting clean-up code in tearDown. Using tearDown causes problems with developing and testing because if there's an exception raised in setUp then tearDown is not called and this can affect other tests and make it hard to figure out what the problem was. Also, this should make it easier to switch to using fixtures since fixtures use cleanUp. Change-Id: Ifc22dfd9012402c895a09534f4b1d9bd7a2ec931 --- keystoneclient/tests/test_https.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'keystoneclient/tests/test_https.py') diff --git a/keystoneclient/tests/test_https.py b/keystoneclient/tests/test_https.py index b4a955b..5cc5803 100644 --- a/keystoneclient/tests/test_https.py +++ b/keystoneclient/tests/test_https.py @@ -50,10 +50,7 @@ class ClientTest(utils.TestCase): self.request_patcher = mock.patch.object(requests, 'request', self.mox.CreateMockAnything()) self.request_patcher.start() - - def tearDown(self): - self.request_patcher.stop() - super(ClientTest, self).tearDown() + self.addCleanup(self.request_patcher.stop) @mock.patch.object(session.requests.Session, 'request') def test_get(self, MOCK_REQUEST): -- cgit v1.2.1