Back to Intellij Community

PyMockPatchArgumentCountInspection

python/pluginResources/inspectionDescriptions/PyMockPatchArgumentCountInspection.html

2025.3-rc-2360 B
Original Source

Reports functions decorated with @patch or @patch.object where the number of parameters does not match the number of mock objects injected by the decorators.

Each @patch decorator without an explicit new= argument injects one additional parameter. The innermost decorator injects the first parameter (after self), and the outermost injects the last.