Skip to content

Commit e10850e

Browse files
committed
STY: condense code some more
1 parent cd4c42b commit e10850e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

lib/matplotlib/testing/decorators.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -381,8 +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-
POK = inspect.Parameter.POSITIONAL_OR_KEYWORD
385-
384+
POSITIONAL_OR_KEYWORD = inspect.Parameter.POSITIONAL_OR_KEYWORD
386385
def decorator(func):
387386
import pytest
388387

@@ -405,14 +404,10 @@ def wrapper(*args, ext, **kwargs):
405404

406405
sig = inspect.signature(func)
407406
new_sig = sig.replace(
408-
parameters=(
409-
[
410-
param
411-
for param in sig.parameters.values()
412-
if param.name not in {"fig_test", "fig_ref"}
413-
]
414-
+ [inspect.Parameter("ext", POK)]
415-
)
407+
parameters=([param
408+
for param in sig.parameters.values()
409+
if param.name not in {"fig_test", "fig_ref"}]
410+
+ [inspect.Parameter("ext", POSITIONAL_OR_KEYWORD)])
416411
)
417412
wrapper.__signature__ = new_sig
418413

0 commit comments

Comments
 (0)