@@ -24,19 +24,19 @@ def mpl_test_settings(request):
2424 original_settings = matplotlib .rcParams .copy ()
2525
2626 backend = None
27- backend_marker = request .keywords . get ('backend' )
27+ backend_marker = request .node . get_closest_marker ('backend' )
2828 if backend_marker is not None :
2929 assert len (backend_marker .args ) == 1 , \
3030 "Marker 'backend' must specify 1 backend."
31- backend = backend_marker .args [ 0 ]
31+ backend , = backend_marker .args
3232 prev_backend = matplotlib .get_backend ()
3333
3434 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' )
3636 if style_marker is not None :
3737 assert len (style_marker .args ) == 1 , \
3838 "Marker 'style' must specify 1 style."
39- style = style_marker .args [ 0 ]
39+ style , = style_marker .args
4040
4141 matplotlib .testing .setup ()
4242 if backend is not None :
@@ -64,7 +64,7 @@ def mpl_image_comparison_parameters(request, extension):
6464 # pytest won't get confused.
6565 # We annotate the decorated function with any parameters captured by this
6666 # 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
6868 if baseline_images is None :
6969 # Allow baseline image list to be produced on the fly based on current
7070 # parametrization.
0 commit comments