How to remove patched dependency in python unit tests

647 views Asked by At

Given the following unit test

@patch("requests.get")
def test_create_resource_success(self, request_get):
    request_get_mock.return_value = Mock(ok=True)
    request_get_mock.return_value.json.return_value = {'key': 'value'}
    success = create_resource(data)
    self.assertTrue(success)

How do I make sure that all other unit tests usages of requests.get are not patched? How do I reset the patching in the tearDown?

0

There are 0 answers