Python Unittest: Is there a way to capture the return value of a method that is called in the call stack?
Summary In unit testing with Python’s unittest.mock, capturing the return value of a method requires returning the value from the mock to the caller (the code under test), while also intercepting the call for assertions. The confusion with wraps often stems from expecting the wrapper function to automatically capture the return value of the mocked … Read more