10
10
"theme_name, expected_icons" ,
11
11
[("dark" , "white" ), ("light" , "black" )],
12
12
)
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 ):
16
14
"""Check that the icons are taken from the correct folder for each napari theme."""
17
15
viewer = make_napari_viewer ()
18
16
viewer .theme = theme_name
19
17
path_to_icons = NapariMPLWidget (viewer )._get_path_to_icon ()
20
18
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
+ )
24
22
25
23
26
24
def _mock_up_theme () -> None :
@@ -32,9 +30,7 @@ def _mock_up_theme() -> None:
32
30
blue_theme = napari .utils .theme .get_theme ("dark" )
33
31
blue_theme .label = "blue"
34
32
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" )
38
34
39
35
40
36
def test_theme_background_check (make_napari_viewer ):
@@ -62,9 +58,7 @@ def test_theme_background_check(make_napari_viewer):
62
58
("light" , "#3b3a39" ), # #3b3a39 is a brownish dark grey (almost black)
63
59
],
64
60
)
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 ):
68
62
"""
69
63
Test that the axis labels and titles are the correct color for the napari theme.
70
64
"""
@@ -114,9 +108,7 @@ def test_no_theme_side_effects(make_napari_viewer):
114
108
ax .hist (normal_dist , bins = 100 )
115
109
ax .set_xlabel ("something unrelated to napari (x)" )
116
110
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" )
120
112
unrelated_figure .tight_layout ()
121
113
122
114
return unrelated_figure
0 commit comments