Derived from the flake8-pytest-style linter.
What it does#
Checks for mocked calls that use a dummy
lambda function instead of
Why is this bad?#
When patching calls, an explicit
return_value better conveys the intent
lambda function, assuming the
lambda does not use the arguments
passed to it.
return_value is also robust to changes in the patched function's
signature, and enables additional assertions to verify behavior. For
return_value allows for verification of the number of calls or
the arguments passed to the patched function via
and related methods.