pytest-dev/pytest-mock

Not sure why this is not working

jiz17043 opened this issue · 3 comments

image
image
Try to mock the response of the function in the httprequest_gecko module but it seems not working. Please let me know if you have any suggestions. Thank you!
I am using the latest versions of pytest (7.1.2) and pytest-mock (3.11.1) on Python 3.9.2.

Not sure off hand what the issue is, but looks like you're not even using pytest-mock in that screenshot - so this isn't an issue with the plugin.

I would like to ask for any suggestions if I want to mock a function.

@jiz17043 see this section in the docs, as it is likely relevant:

https://docs.python.org/3/library/unittest.mock.html#where-to-patch