From 6269f50abccf31a78784cb0842a85b5d45f2de39 Mon Sep 17 00:00:00 2001 From: Joe Talbott Date: Thu, 5 Feb 2015 17:27:39 -0500 Subject: [PATCH] Don't bother creating another mocked urllib.urlopen. --- tests/test_boottest.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_boottest.py b/tests/test_boottest.py index 03d0ece..3582415 100644 --- a/tests/test_boottest.py +++ b/tests/test_boottest.py @@ -90,10 +90,7 @@ class TestTouchManifest(unittest.TestCase): self.assertIn('foo', manifest) def test_fetch_exception(self): - _p = mock.patch('urllib.urlopen') - mocked_urlopen = _p.start() - self.addCleanup(_p.stop) - mocked_urlopen.side_effect = [IOError("connection refused")] + self.mocked_urlopen.side_effect = [IOError("connection refused")] manifest = boottest.TouchManifest('not-real', 'not-real') self.assertEqual(0, len(manifest._manifest))