Skip to content

Commit 4256ead

Browse files
QuLogicksunden
authored andcommitted
Backport PR matplotlib#29827: TST: Remove unnecessary test images
1 parent 948ddbf commit 4256ead

10 files changed

Lines changed: 29 additions & 29 deletions

File tree

lib/matplotlib/tests/test_axes.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_repr():
7676
"label='label', title={'center': 'title'}, xlabel='x', ylabel='y'>")
7777

7878

79-
@check_figures_equal()
79+
@check_figures_equal(extensions=['png'])
8080
def test_label_loc_vertical(fig_test, fig_ref):
8181
ax = fig_test.subplots()
8282
sc = ax.scatter([1, 2], [1, 2], c=[1, 2], label='scatter')
@@ -95,7 +95,7 @@ def test_label_loc_vertical(fig_test, fig_ref):
9595
cbar.set_label("Z Label", y=1, ha='right')
9696

9797

98-
@check_figures_equal()
98+
@check_figures_equal(extensions=['png'])
9999
def test_label_loc_horizontal(fig_test, fig_ref):
100100
ax = fig_test.subplots()
101101
sc = ax.scatter([1, 2], [1, 2], c=[1, 2], label='scatter')
@@ -114,7 +114,7 @@ def test_label_loc_horizontal(fig_test, fig_ref):
114114
cbar.set_label("Z Label", x=0, ha='left')
115115

116116

117-
@check_figures_equal()
117+
@check_figures_equal(extensions=['png'])
118118
def test_label_loc_rc(fig_test, fig_ref):
119119
with matplotlib.rc_context({"xaxis.labellocation": "right",
120120
"yaxis.labellocation": "top"}):
@@ -2350,7 +2350,7 @@ def test_bar_pandas_indexed(pd):
23502350

23512351

23522352
@mpl.style.context('default')
2353-
@check_figures_equal()
2353+
@check_figures_equal(extensions=['png'])
23542354
def test_bar_hatches(fig_test, fig_ref):
23552355
ax_test = fig_test.subplots()
23562356
ax_ref = fig_ref.subplots()
@@ -3399,7 +3399,7 @@ def layers(n, m):
33993399
axs[1, 1].stackplot(range(100), d.T, baseline='weighted_wiggle')
34003400

34013401

3402-
@check_figures_equal()
3402+
@check_figures_equal(extensions=['png'])
34033403
def test_stackplot_hatching(fig_ref, fig_test):
34043404
x = np.linspace(0, 10, 10)
34053405
y1 = 1.0 * x
@@ -3582,7 +3582,7 @@ def test_bxp_customwhisker():
35823582
whiskerprops=dict(linestyle='-', color='m', lw=3)))
35833583

35843584

3585-
@check_figures_equal()
3585+
@check_figures_equal(extensions=['png'])
35863586
def test_boxplot_median_bound_by_box(fig_test, fig_ref):
35873587
data = np.arange(3)
35883588
medianprops_test = {"linewidth": 12}
@@ -4390,7 +4390,7 @@ def test_errorbar_colorcycle():
43904390
assert mcolors.to_rgba(ln1.get_color()) == mcolors.to_rgba('C2')
43914391

43924392

4393-
@check_figures_equal()
4393+
@check_figures_equal(extensions=['png'])
43944394
def test_errorbar_cycle_ecolor(fig_test, fig_ref):
43954395
x = np.arange(0.1, 4, 0.5)
43964396
y = [np.exp(-x+n) for n in range(4)]
@@ -4589,7 +4589,7 @@ def test_xerr_yerr_not_none():
45894589
ax.errorbar(x=[0], y=[0], yerr=[[None], [1]])
45904590

45914591

4592-
@check_figures_equal()
4592+
@check_figures_equal(extensions=['png'])
45934593
def test_errorbar_every(fig_test, fig_ref):
45944594
x = np.linspace(0, 1, 15)
45954595
y = x * (1-x)
@@ -5441,7 +5441,7 @@ def test_eb_line_zorder():
54415441
ax.set_title("errorbar zorder test")
54425442

54435443

5444-
@check_figures_equal()
5444+
@check_figures_equal(extensions=['png'])
54455445
def test_axline_loglog(fig_test, fig_ref):
54465446
ax = fig_test.subplots()
54475447
ax.set(xlim=(0.1, 10), ylim=(1e-3, 1))
@@ -5454,7 +5454,7 @@ def test_axline_loglog(fig_test, fig_ref):
54545454
ax.loglog([1, 10], [1e-3, 1e-2], c="k")
54555455

54565456

5457-
@check_figures_equal()
5457+
@check_figures_equal(extensions=['png'])
54585458
def test_axline(fig_test, fig_ref):
54595459
ax = fig_test.subplots()
54605460
ax.set(xlim=(-1, 1), ylim=(-1, 1))
@@ -5477,7 +5477,7 @@ def test_axline(fig_test, fig_ref):
54775477
ax.axvline(-0.5, color='C5')
54785478

54795479

5480-
@check_figures_equal()
5480+
@check_figures_equal(extensions=['png'])
54815481
def test_axline_transaxes(fig_test, fig_ref):
54825482
ax = fig_test.subplots()
54835483
ax.set(xlim=(-1, 1), ylim=(-1, 1))
@@ -5494,7 +5494,7 @@ def test_axline_transaxes(fig_test, fig_ref):
54945494
ax.plot([0, 0], [-1, 1], color='C3')
54955495

54965496

5497-
@check_figures_equal()
5497+
@check_figures_equal(extensions=['png'])
54985498
def test_axline_transaxes_panzoom(fig_test, fig_ref):
54995499
# test that it is robust against pan/zoom and
55005500
# figure resize after plotting
@@ -6550,7 +6550,7 @@ def test_normalize_kwarg_pie():
65506550
assert abs(t2[0][-1].theta2 - 360.) > 1e-3
65516551

65526552

6553-
@check_figures_equal()
6553+
@check_figures_equal(extensions=['png'])
65546554
def test_pie_hatch_single(fig_test, fig_ref):
65556555
x = [0.3, 0.3, 0.1]
65566556
hatch = '+'
@@ -6559,7 +6559,7 @@ def test_pie_hatch_single(fig_test, fig_ref):
65596559
[w.set_hatch(hatch) for w in wedges]
65606560

65616561

6562-
@check_figures_equal()
6562+
@check_figures_equal(extensions=['png'])
65636563
def test_pie_hatch_multi(fig_test, fig_ref):
65646564
x = [0.3, 0.3, 0.1]
65656565
hatch = ['/', '+', '.']
@@ -9662,7 +9662,7 @@ def test_boxplot_tick_labels():
96629662

96639663

96649664
@needs_usetex
9665-
@check_figures_equal()
9665+
@check_figures_equal(extensions=['png'])
96669666
def test_latex_pie_percent(fig_test, fig_ref):
96679667

96689668
data = [20, 10, 70]

lib/matplotlib/tests/test_colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ def test_scalarmappable_norm_update():
16781678
assert sm.stale
16791679

16801680

1681-
@check_figures_equal()
1681+
@check_figures_equal(extensions=['png'])
16821682
def test_norm_update_figs(fig_test, fig_ref):
16831683
ax_ref = fig_ref.add_subplot()
16841684
ax_test = fig_test.add_subplot()

lib/matplotlib/tests/test_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_imshow_zoom(fig_test, fig_ref):
122122
ax.set_ylim(10, 20)
123123

124124

125-
@check_figures_equal()
125+
@check_figures_equal(extensions=['png'])
126126
def test_imshow_pil(fig_test, fig_ref):
127127
style.use("default")
128128
png_path = Path(__file__).parent / "baseline_images/pngsuite/basn3p04.png"
@@ -1384,7 +1384,7 @@ def test_huge_range_log(fig_test, fig_ref, x):
13841384
interpolation='nearest', cmap=cmap)
13851385

13861386

1387-
@check_figures_equal()
1387+
@check_figures_equal(extensions=['png'])
13881388
def test_spy_box(fig_test, fig_ref):
13891389
# setting up reference and test
13901390
ax_test = fig_test.subplots(1, 3)

lib/matplotlib/tests/test_legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ def test_legend_markers_from_line2d():
14691469
assert labels == new_labels
14701470

14711471

1472-
@check_figures_equal()
1472+
@check_figures_equal(extensions=['png'])
14731473
def test_ncol_ncols(fig_test, fig_ref):
14741474
# Test that both ncol and ncols work
14751475
strings = ["a", "b", "c", "d", "e", "f"]

lib/matplotlib/tests/test_lines.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def test_is_sorted_and_has_non_nan():
252252
plt.plot([np.nan] * n, range(n))
253253

254254

255-
@check_figures_equal()
255+
@check_figures_equal(extensions=['png'])
256256
def test_step_markers(fig_test, fig_ref):
257257
fig_test.subplots().step([0, 1], "-o")
258258
fig_ref.subplots().plot([0, 0, 1], [0, 1, 1], "-o", markevery=[0, 2])
@@ -342,7 +342,7 @@ def test_striped_lines(text_placeholders):
342342
ax.legend(handlelength=5)
343343

344344

345-
@check_figures_equal()
345+
@check_figures_equal(extensions=['png'])
346346
def test_odd_dashes(fig_test, fig_ref):
347347
fig_test.add_subplot().plot([1, 2], dashes=[1, 2, 3])
348348
fig_ref.add_subplot().plot([1, 2], dashes=[1, 2, 3, 1, 2, 3])
@@ -374,7 +374,7 @@ def test_picking():
374374
assert_array_equal(indices['ind'], [0])
375375

376376

377-
@check_figures_equal()
377+
@check_figures_equal(extensions=['png'])
378378
def test_input_copy(fig_test, fig_ref):
379379

380380
t = np.arange(0, 6, 2)

lib/matplotlib/tests/test_offsetbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def test_textarea_properties():
412412
assert ta.get_multilinebaseline()
413413

414414

415-
@check_figures_equal()
415+
@check_figures_equal(extensions=['png'])
416416
def test_textarea_set_text(fig_test, fig_ref):
417417
ax_ref = fig_ref.add_subplot()
418418
text0 = AnchoredText("Foo", "upper left")

lib/matplotlib/tests/test_polar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_polar_twice():
100100
assert len(fig.axes) == 1, 'More than one polar Axes created.'
101101

102102

103-
@check_figures_equal()
103+
@check_figures_equal(extensions=['png'])
104104
def test_polar_wrap(fig_test, fig_ref):
105105
ax = fig_test.add_subplot(projection="polar")
106106
ax.plot(np.deg2rad([179, -179]), [0.2, 0.1])
@@ -110,7 +110,7 @@ def test_polar_wrap(fig_test, fig_ref):
110110
ax.plot(np.deg2rad([2, 358]), [0.2, 0.1])
111111

112112

113-
@check_figures_equal()
113+
@check_figures_equal(extensions=['png'])
114114
def test_polar_units_1(fig_test, fig_ref):
115115
import matplotlib.testing.jpl_units as units
116116
units.register()
@@ -125,7 +125,7 @@ def test_polar_units_1(fig_test, fig_ref):
125125
ax.set(xlabel="deg")
126126

127127

128-
@check_figures_equal()
128+
@check_figures_equal(extensions=['png'])
129129
def test_polar_units_2(fig_test, fig_ref):
130130
import matplotlib.testing.jpl_units as units
131131
units.register()

lib/matplotlib/tests/test_scale.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import pytest
2020

2121

22-
@check_figures_equal()
22+
@check_figures_equal(extensions=['png'])
2323
def test_log_scales(fig_test, fig_ref):
2424
ax_test = fig_test.add_subplot(122, yscale='log', xscale='symlog')
2525
ax_test.axvline(24.1)

lib/matplotlib/tests/test_triangulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ def test_tricontourset_reuse():
13211321
assert tcs3._contour_generator == tcs1._contour_generator
13221322

13231323

1324-
@check_figures_equal()
1324+
@check_figures_equal(extensions=['png'])
13251325
def test_triplot_with_ls(fig_test, fig_ref):
13261326
x = [0, 2, 1]
13271327
y = [0, 0, 1]

lib/matplotlib/tests/test_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ def test_polygon_selector_set_props_handle_props(ax, draw_bounding_box):
15241524
assert artist.get_alpha() == 0.3
15251525

15261526

1527-
@check_figures_equal()
1527+
@check_figures_equal(extensions=['png'])
15281528
def test_rect_visibility(fig_test, fig_ref):
15291529
# Check that requesting an invisible selector makes it invisible
15301530
ax_test = fig_test.subplots()

0 commit comments

Comments
 (0)