diff options
| author | Brant Knudson <bknudson@us.ibm.com> | 2014-01-06 16:06:17 -0600 |
|---|---|---|
| committer | Brant Knudson <bknudson@us.ibm.com> | 2014-01-21 06:57:36 -0600 |
| commit | f82edf87219bc0b411e702d773e0b764a1d2ce5b (patch) | |
| tree | 5568fb5b92348e6b6dc7a423b943c1edbbb233cf /keystoneclient/tests/test_https.py | |
| parent | 19d0396224b5a83ef9a22b42e8292e2921136e14 (diff) | |
| download | python-keystoneclient-f82edf87219bc0b411e702d773e0b764a1d2ce5b.tar.gz | |
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
Diffstat (limited to 'keystoneclient/tests/test_https.py')
| -rw-r--r-- | keystoneclient/tests/test_https.py | 5 |
1 files changed, 1 insertions, 4 deletions
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): |
