2626@pytest .mark .skipif (sys .platform != "linux" , reason = "Linux only" )
2727@pytest .mark .mpl_image_compare (style = "default" , remove_text = False )
2828def test_style_atlas ():
29- plt .rcParams .update (plt .rcParamsDefault )
30-
3129 # Test suite does not have Helvetica
3230 plt .style .use ([hep .style .ATLAS , {"font.sans-serif" : ["Tex Gyre Heros" ]}])
3331 fig , ax = plt .subplots ()
@@ -39,8 +37,6 @@ def test_style_atlas():
3937@pytest .mark .skipif (sys .platform != "linux" , reason = "Linux only" )
4038@pytest .mark .mpl_image_compare (style = "default" , remove_text = False )
4139def test_style_cms ():
42- plt .rcParams .update (plt .rcParamsDefault )
43-
4440 plt .style .use (hep .style .CMS )
4541 fig , ax = plt .subplots ()
4642 hep .cms .label ("Preliminary" )
@@ -51,8 +47,6 @@ def test_style_cms():
5147@pytest .mark .skipif (sys .platform != "linux" , reason = "Linux only" )
5248@pytest .mark .mpl_image_compare (style = "default" , remove_text = False )
5349def test_style_alice ():
54- plt .rcParams .update (plt .rcParamsDefault )
55-
5650 plt .style .use (hep .style .ALICE )
5751 fig , ax = plt .subplots ()
5852 hep .alice .label ("Preliminary" )
@@ -63,8 +57,6 @@ def test_style_alice():
6357@pytest .mark .skipif (sys .platform != "linux" , reason = "Linux only" )
6458@pytest .mark .mpl_image_compare (style = "default" , remove_text = False )
6559def test_style_lhcb ():
66- plt .rcParams .update (plt .rcParamsDefault )
67-
6860 plt .style .use ([hep .style .LHCb1 , {"figure.autolayout" : False }])
6961 fig , ax = plt .subplots ()
7062 hep .lhcb .label ("Preliminary" )
@@ -74,8 +66,6 @@ def test_style_lhcb():
7466@pytest .mark .skipif (sys .platform != "linux" , reason = "Linux only" )
7567@pytest .mark .mpl_image_compare (style = "default" , remove_text = False )
7668def test_style_lhcb2 ():
77- plt .rcParams .update (plt .rcParamsDefault )
78-
7969 plt .style .use ([hep .style .LHCb2 , {"figure.autolayout" : False }])
8070 fig , ax = plt .subplots ()
8171 hep .lhcb .label ("Preliminary" )
@@ -85,7 +75,6 @@ def test_style_lhcb2():
8575@pytest .mark .skipif (sys .platform != "linux" , reason = "Linux only" )
8676@pytest .mark .mpl_image_compare (style = "default" , remove_text = False )
8777def test_style_plothist ():
88- plt .rcParams .update (plt .rcParamsDefault )
8978 plt .style .use (hep .style .PLOTHIST )
9079 fig , ax = plt .subplots ()
9180 return fig
@@ -106,8 +95,6 @@ def test_style_plothist():
10695 ids = ["ALICE" , "ATLAS" , "CMS" , "LHCb1" , "LHCb2" , "ROOT" ],
10796)
10897def test_use_style (fig_test , fig_ref , mplhep_style ):
109- plt .rcParams .update (plt .rcParamsDefault )
110-
11198 hep .rcParams .clear ()
11299 plt .style .use (mplhep_style )
113100 fig_ref .subplots ()
@@ -120,8 +107,6 @@ def test_use_style(fig_test, fig_ref, mplhep_style):
120107@pytest .mark .skipif (sys .platform != "linux" , reason = "Linux only" )
121108@check_figures_equal (extensions = ["pdf" ])
122109def test_use_style_LHCb_dep (fig_test , fig_ref ):
123- plt .rcParams .update (plt .rcParamsDefault )
124-
125110 hep .rcParams .clear ()
126111 with pytest .warns (FutureWarning ):
127112 plt .style .use (hep .style .LHCb )
@@ -148,8 +133,6 @@ def test_use_style_LHCb_dep(fig_test, fig_ref):
148133 ids = ["ALICE" , "ATLAS" , "CMS" , "LHCb" , "LHCb1" , "LHCb2" , "ROOT" ],
149134)
150135def test_use_style_str_alias (fig_test , fig_ref , mplhep_style , str_alias ):
151- plt .rcParams .update (plt .rcParamsDefault )
152-
153136 hep .rcParams .clear ()
154137 plt .style .use (mplhep_style )
155138 fig_ref .subplots ()
@@ -175,8 +158,6 @@ def test_use_style_str_alias(fig_test, fig_ref, mplhep_style, str_alias):
175158 ids = ["ALICE" , "ATLAS" , "CMS" , "LHCb" , "LHCb1" , "LHCb2" , "ROOT" ],
176159)
177160def test_use_style_self_consistent (fig_test , fig_ref , mplhep_style , str_alias ):
178- plt .rcParams .update (plt .rcParamsDefault )
179-
180161 hep .rcParams .clear ()
181162 hep .style .use (mplhep_style )
182163 fig_ref .subplots ()
@@ -202,8 +183,6 @@ def test_use_style_self_consistent(fig_test, fig_ref, mplhep_style, str_alias):
202183 ids = ["ALICE" , "ATLAS" , "CMS" , "LHCb" , "LHCb1" , "LHCb2" , "ROOT" ],
203184)
204185def test_use_style_style_list (fig_test , fig_ref , mplhep_style , str_alias ):
205- plt .rcParams .update (plt .rcParamsDefault )
206-
207186 hep .rcParams .clear ()
208187 plt .style .use ([mplhep_style , {"font.sans-serif" : "Comic Sans MS" }])
209188 fig_ref .subplots ()
0 commit comments