@@ -24,19 +24,19 @@ def mpl_test_settings(request):
24
24
with _cleanup_cm ():
25
25
26
26
backend = None
27
- backend_marker = request .keywords . get ('backend' )
27
+ backend_marker = request .node . get_closest_marker ('backend' )
28
28
if backend_marker is not None :
29
29
assert len (backend_marker .args ) == 1 , \
30
30
"Marker 'backend' must specify 1 backend."
31
- backend = backend_marker .args [ 0 ]
31
+ backend , = backend_marker .args
32
32
prev_backend = matplotlib .get_backend ()
33
33
34
34
style = '_classic_test' # Default of cleanup and image_comparison too.
35
- style_marker = request .keywords . get ('style' )
35
+ style_marker = request .node . get_closest_marker ('style' )
36
36
if style_marker is not None :
37
37
assert len (style_marker .args ) == 1 , \
38
38
"Marker 'style' must specify 1 style."
39
- style = style_marker .args [ 0 ]
39
+ style , = style_marker .args
40
40
41
41
matplotlib .testing .setup ()
42
42
if backend is not None :
@@ -64,7 +64,7 @@ def mpl_image_comparison_parameters(request, extension):
64
64
# pytest won't get confused.
65
65
# We annotate the decorated function with any parameters captured by this
66
66
# fixture so that they can be used by the wrapper in image_comparison.
67
- baseline_images = request .keywords [ 'baseline_images' ] .args [ 0 ]
67
+ baseline_images , = request .node . get_closest_marker ( 'baseline_images' ) .args
68
68
if baseline_images is None :
69
69
# Allow baseline image list to be produced on the fly based on current
70
70
# parametrization.
0 commit comments