pylint: Fix E1120 no-value-for-parameter for mocks

Currently pylint is returning E1120 errors such as

 No value for argument 'mock_clean' in method call
 (no-value-for-parameter)

These are not correct and are cause by the mock decorator modifying the
parameters received by the method, as mentioned in
https://github.com/PyCQA/pylint/issues/259

This patch adds the configuration option signature-mutators to pylint
telling it that patch and patch.object mutate the method signatures.

Change-Id: Iac8cd96c87b7d812a937ba7d978034c37fc2eedd
This commit is contained in:
Gorka Eguileor 2021-04-16 11:44:01 +02:00
parent c12375fec6
commit d2d5e92503
1 changed files with 1 additions and 0 deletions

View File

@ -222,6 +222,7 @@ additional-builtins=_
[TYPECHECK]
# List of module names for which member attributes should not be checked
ignored-modules=six.moves,_MovedItems
signature-mutators=unittest.mock.patch,unittest.mock.patch.object
# This is for cinder.objects.*, and requests.packages.*, but due to
# https://github.com/PyCQA/pylint/issues/2498