77import matplotlib
88import matplotlib .ft2font
99from packaging .version import Version
10+ import pytest
1011
1112from .helpers import assert_existence , diff_summary , patch_summary
1213
@@ -113,19 +114,23 @@ def test_default(tmp_path):
113114 run_subtest ('test_default' , tmp_path , [])
114115
115116
117+ @pytest .mark .skipif (not HASH_LIBRARY .exists (), reason = "No hash library for this mpl version" )
116118def test_hash (tmp_path ):
117119 run_subtest ('test_hash' , tmp_path , [HASH_LIBRARY_FLAG ])
118120
119121
122+ @pytest .mark .skipif (not HASH_LIBRARY .exists (), reason = "No hash library for this mpl version" )
120123def test_hybrid (tmp_path ):
121124 run_subtest ('test_hybrid' , tmp_path , [HASH_LIBRARY_FLAG , BASELINE_IMAGES_FLAG ])
122125
123126
127+ @pytest .mark .skipif (not HASH_LIBRARY .exists (), reason = "No hash library for this mpl version" )
124128def test_results_always (tmp_path ):
125129 run_subtest ('test_results_always' , tmp_path ,
126130 [HASH_LIBRARY_FLAG , BASELINE_IMAGES_FLAG , '--mpl-results-always' ])
127131
128132
133+ @pytest .mark .skipif (not HASH_LIBRARY .exists (), reason = "No hash library for this mpl version" )
129134def test_html (tmp_path ):
130135 run_subtest ('test_results_always' , tmp_path ,
131136 [HASH_LIBRARY_FLAG , BASELINE_IMAGES_FLAG ], summaries = ['html' ])
@@ -134,6 +139,7 @@ def test_html(tmp_path):
134139 assert (tmp_path / 'results' / 'styles.css' ).exists ()
135140
136141
142+ @pytest .mark .skipif (not HASH_LIBRARY .exists (), reason = "No hash library for this mpl version" )
137143def test_html_hashes_only (tmp_path ):
138144 run_subtest ('test_html_hashes_only' , tmp_path , [HASH_LIBRARY_FLAG ], summaries = ['html' ])
139145 assert (tmp_path / 'results' / 'fig_comparison.html' ).exists ()
@@ -148,6 +154,7 @@ def test_html_images_only(tmp_path):
148154 assert (tmp_path / 'results' / 'styles.css' ).exists ()
149155
150156
157+ @pytest .mark .skipif (not HASH_LIBRARY .exists (), reason = "No hash library for this mpl version" )
151158def test_basic_html (tmp_path ):
152159 run_subtest ('test_results_always' , tmp_path ,
153160 [HASH_LIBRARY_FLAG , BASELINE_IMAGES_FLAG ], summaries = ['basic-html' ])
0 commit comments