|
165 | 165 | for set in chars: |
166 | 166 | font_tests.append(wrapper % set) |
167 | 167 |
|
168 | | -font_tests = list(filter(lambda x: x[1] is not None, enumerate(font_tests))) |
169 | | - |
170 | 168 |
|
171 | 169 | @pytest.fixture |
172 | | -def baseline_images(request, fontset, index): |
| 170 | +def baseline_images(request, fontset, index, text): |
| 171 | + if text is None: |
| 172 | + pytest.skip("test has been removed") |
173 | 173 | return ['%s_%s_%02d' % (request.param, fontset, index)] |
174 | 174 |
|
175 | 175 |
|
176 | | -cur_math_tests = list(filter(lambda x: x[1] is not None, enumerate(math_tests))) |
177 | | - |
178 | | - |
179 | | -@pytest.mark.parametrize('index, test', cur_math_tests, |
180 | | - ids=[str(index) for index, _ in cur_math_tests]) |
181 | | -@pytest.mark.parametrize('fontset', |
182 | | - ['cm', 'stix', 'stixsans', 'dejavusans', |
183 | | - 'dejavuserif']) |
| 176 | +@pytest.mark.parametrize( |
| 177 | + 'index, text', enumerate(math_tests), ids=range(len(math_tests))) |
| 178 | +@pytest.mark.parametrize( |
| 179 | + 'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif']) |
184 | 180 | @pytest.mark.parametrize('baseline_images', ['mathtext'], indirect=True) |
185 | 181 | @image_comparison(baseline_images=None) |
186 | | -def test_mathtext_rendering(baseline_images, fontset, index, test): |
| 182 | +def test_mathtext_rendering(baseline_images, fontset, index, text): |
187 | 183 | mpl.rcParams['mathtext.fontset'] = fontset |
188 | 184 | fig = plt.figure(figsize=(5.25, 0.75)) |
189 | | - fig.text(0.5, 0.5, test, |
| 185 | + fig.text(0.5, 0.5, text, |
190 | 186 | horizontalalignment='center', verticalalignment='center') |
191 | 187 |
|
192 | 188 |
|
193 | | -@pytest.mark.parametrize('index, test', font_tests, |
194 | | - ids=[str(index) for index, _ in font_tests]) |
195 | | -@pytest.mark.parametrize('fontset', |
196 | | - ['cm', 'stix', 'stixsans', 'dejavusans', |
197 | | - 'dejavuserif']) |
| 189 | +@pytest.mark.parametrize( |
| 190 | + 'index, text', enumerate(font_tests), ids=range(len(font_tests))) |
| 191 | +@pytest.mark.parametrize( |
| 192 | + 'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif']) |
198 | 193 | @pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True) |
199 | 194 | @image_comparison(baseline_images=None, extensions=['png']) |
200 | | -def test_mathfont_rendering(baseline_images, fontset, index, test): |
| 195 | +def test_mathfont_rendering(baseline_images, fontset, index, text): |
201 | 196 | mpl.rcParams['mathtext.fontset'] = fontset |
202 | 197 | fig = plt.figure(figsize=(5.25, 0.75)) |
203 | | - fig.text(0.5, 0.5, test, |
| 198 | + fig.text(0.5, 0.5, text, |
204 | 199 | horizontalalignment='center', verticalalignment='center') |
205 | 200 |
|
206 | 201 |
|
|
0 commit comments