Add tearDown for `gold.test_signals` with an old mocking pattern
If we don't call `.stop` after running these tests, the mock is still present
for the tests ran after them and it generates conflicts.
@@ -22,6 +22,14 @@ class GoldSignalTests(TestCase):
self.mocks['request'] = self.mocks['requestor'].return_value
+ def tearDown(self):
+ # TODO: refactor to use request_mocks for these. The current mock
+ # pattern breaks tests ran after these if tearDown is not called with
+ # the `.stop` for all the patches. It took me a lot of time to realized
+ # about this problem.
+ for _, patch in self.patches.items():
+ patch.stop()
+
def mock_request(self, resp=None):
if resp is None:
resp = ({}, '')
