def setUp(self): super(TestCase, self).setUp() self.addCleanup(mock.patch.stopall) app.app.config["TESTING"] = True self.app = app.app.test_client()