Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b57fba

Browse files
committed
MNT: correctly label the inject kwargs as kwonly
They are preceded by a `*args` in the signature of wrapper.
1 parent dbb78a0 commit 3b57fba

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def test_plot(fig_test, fig_ref):
381381
fig_test.subplots().plot([1, 3, 5])
382382
fig_ref.subplots().plot([0, 1, 2], [1, 3, 5])
383383
"""
384-
POSITIONAL_OR_KEYWORD = inspect.Parameter.POSITIONAL_OR_KEYWORD
384+
KEYWORD_ONLY = inspect.Parameter.KEYWORD_ONLY
385385
def decorator(func):
386386
import pytest
387387

@@ -410,9 +410,10 @@ def wrapper(*args, ext, request, **kwargs):
410410
parameters=([param
411411
for param in sig.parameters.values()
412412
if param.name not in {"fig_test", "fig_ref"}]
413-
+ [inspect.Parameter("ext", POSITIONAL_OR_KEYWORD),
414-
inspect.Parameter("request", POSITIONAL_OR_KEYWORD),
415-
])
413+
+ [
414+
inspect.Parameter("ext", KEYWORD_ONLY),
415+
inspect.Parameter("request", KEYWORD_ONLY),
416+
])
416417
)
417418
wrapper.__signature__ = new_sig
418419

0 commit comments

Comments
 (0)