1010 "theme_name, expected_icons" ,
1111 [("dark" , "white" ), ("light" , "black" )],
1212)
13- def test_theme_mpl_toolbar_icons (
14- make_napari_viewer , theme_name , expected_icons
15- ):
13+ def test_theme_mpl_toolbar_icons (make_napari_viewer , theme_name , expected_icons ):
1614 """Check that the icons are taken from the correct folder for each napari theme."""
1715 viewer = make_napari_viewer ()
1816 viewer .theme = theme_name
1917 path_to_icons = NapariMPLWidget (viewer )._get_path_to_icon ()
2018 assert path_to_icons .exists (), "The theme points to non-existant icons."
21- assert (
22- path_to_icons . stem == expected_icons
23- ), "The theme is selecting unexpected icons."
19+ assert path_to_icons . stem == expected_icons , (
20+ "The theme is selecting unexpected icons."
21+ )
2422
2523
2624def _mock_up_theme () -> None :
@@ -32,9 +30,7 @@ def _mock_up_theme() -> None:
3230 blue_theme = napari .utils .theme .get_theme ("dark" )
3331 blue_theme .label = "blue"
3432 blue_theme .background = "#4169e1" # my favourite shade of blue
35- napari .utils .theme .register_theme (
36- "blue" , blue_theme , source = "napari-mpl-tests"
37- )
33+ napari .utils .theme .register_theme ("blue" , blue_theme , source = "napari-mpl-tests" )
3834
3935
4036def test_theme_background_check (make_napari_viewer ):
@@ -62,9 +58,7 @@ def test_theme_background_check(make_napari_viewer):
6258 ("light" , "#3b3a39" ), # #3b3a39 is a brownish dark grey (almost black)
6359 ],
6460)
65- def test_titles_respect_theme (
66- make_napari_viewer , theme_name , expected_text_colour
67- ):
61+ def test_titles_respect_theme (make_napari_viewer , theme_name , expected_text_colour ):
6862 """
6963 Test that the axis labels and titles are the correct color for the napari theme.
7064 """
@@ -114,9 +108,7 @@ def test_no_theme_side_effects(make_napari_viewer):
114108 ax .hist (normal_dist , bins = 100 )
115109 ax .set_xlabel ("something unrelated to napari (x)" )
116110 ax .set_ylabel ("something unrelated to napari (y)" )
117- ax .set_title (
118- "this plot style should not change with napari styles or themes"
119- )
111+ ax .set_title ("this plot style should not change with napari styles or themes" )
120112 unrelated_figure .tight_layout ()
121113
122114 return unrelated_figure
0 commit comments