A test utility that patches objects with user-defined code or data.
I am using pythons mock.patch and would like to change the return value for each call. Here is the …
python unit-testing mocking python-mockI have a function (foo) which calls another function (bar). If invoking bar() raises an HttpError, I want to handle …
python unit-testing python-2.7 mocking python-mockI'm using the Mock library to test my application, but I want to assert that some function was not called. …
python unit-testing mocking python-mockI want to understand how to @patch a function from an imported module. This is where I am so far. …
python unit-testing python-unittest python-mockI'm having a fairly difficult time using mock in Python: def method_under_test(): r = requests.post("http://localhost/post") …
python unit-testing testing mocking python-mockI have a base class that defines a class attribute and some child classes that depend on it, e.g. …
python unit-testing mocking python-mockI have a class that I'm testing which has as a dependency another class (an instance of which gets passed …
python unit-testing mocking python-mockI am new to Python, so I apologize if this is a duplicate or overly simple question. I have written …
python unit-testing mocking python-mockOK, I know this is mentioned in the manual, and probably has to do with side_effect and/or return_…
python mocking python-unittest python-mockI'm trying to understand the assert_called_with within mock but the code I wrote throws some error. import os …
python python-unittest python-mock python-unittest.mock