3030 centers_to_edges ,
3131 compare_fiff ,
3232 concatenate_images ,
33+ plt_show ,
3334)
3435
3536base_dir = Path (__file__ ).parents [2 ] / "io" / "tests" / "data"
@@ -46,6 +47,24 @@ def test_setup_vmin_vmax_warns():
4647 _setup_vmin_vmax (data = [- 1 , 0 ], vmin = None , vmax = None , norm = True )
4748
4849
50+ @pytest .mark .parametrize (
51+ ("backend" , "expected" ),
52+ (("module://Matplotlib_Inline.backend_inline" , "pyplot" ), ("QtAgg" , "figure" )),
53+ )
54+ def test_plt_show_backend (monkeypatch , backend , expected ):
55+ """Test backend-specific show paths."""
56+ calls = []
57+
58+ class Figure :
59+ def show (self , ** kwargs ):
60+ calls .append (("figure" , kwargs ))
61+
62+ monkeypatch .setattr ("matplotlib.get_backend" , lambda : backend )
63+ monkeypatch .setattr (plt , "show" , lambda ** kwargs : calls .append (("pyplot" , kwargs )))
64+ plt_show (fig = Figure (), block = True )
65+ assert calls == [(expected , {"block" : True })]
66+
67+
4968def test_get_color_list ():
5069 """Test getting a colormap from rcParams."""
5170 with rc_context ({"axes.prop_cycle" : cycler (color = ["#ff0000" , "#00ff00" ])}):
0 commit comments