summaryrefslogtreecommitdiff
path: root/pylint/test
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/test')
-rw-r--r--pylint/test/functional/arguments.py20
-rw-r--r--pylint/test/functional/arguments.rc2
2 files changed, 22 insertions, 0 deletions
diff --git a/pylint/test/functional/arguments.py b/pylint/test/functional/arguments.py
index ea833ebb7..d023244d6 100644
--- a/pylint/test/functional/arguments.py
+++ b/pylint/test/functional/arguments.py
@@ -215,3 +215,23 @@ partial(some_func, 1, third=2)(second=3)
partial(some_func, 1)(1) # [no-value-for-parameter]
partial(some_func, 1)(third=1) # [no-value-for-parameter]
partial(some_func, 1, 2)(third=1, fourth=4) # [unexpected-keyword-arg]
+
+
+def mutation_decorator(fun):
+ """Decorator that changes a function's signature."""
+ def wrapper(*args, do_something=True, **kwargs):
+ if do_something:
+ return fun(*args, **kwargs)
+
+ return None
+
+ return wrapper
+
+
+@mutation_decorator
+def mutated_function(arg):
+ return arg
+
+
+mutated_function(do_something=False)
+mutated_function()
diff --git a/pylint/test/functional/arguments.rc b/pylint/test/functional/arguments.rc
new file mode 100644
index 000000000..bb6bf0e37
--- /dev/null
+++ b/pylint/test/functional/arguments.rc
@@ -0,0 +1,2 @@
+[TYPECHECK]
+signature-mutators=functional.arguments.mutation_decorator