Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cdab0ab

Browse filesBrowse files
committed
TST: Increase tolerance on more arches
Not sure why this didn't hit Fedora when 3.10.0 was initially built, but it is now during the F42 Mass Rebuild. These tests are already covered by `arm64`-specific tolerances (aka Apple Silicon), and while one or two won't need it, I've changed all of these. Additionally, instead of listing every single architecture, just increase the tolerance on non-x86_64. Also, make a few tweaks to existing conditions to make these all consistent.
1 parent bdf7e8b commit cdab0ab
Copy full SHA for cdab0ab

21 files changed

+65
-71
lines changed

‎lib/matplotlib/tests/test_arrow_patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_arrow_patches.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def draw_arrow(ax, t, r):
1212

1313

1414
@image_comparison(['fancyarrow_test_image'],
15-
tol=0.012 if platform.machine() == 'arm64' else 0)
15+
tol=0.012 if platform.machine() != 'x86_64' else 0)
1616
def test_fancyarrow():
1717
# Added 0 to test division by zero error described in issue 3930
1818
r = [0.4, 0.3, 0.2, 0.1, 0]
@@ -68,7 +68,7 @@ def __prepare_fancyarrow_dpi_cor_test():
6868

6969

7070
@image_comparison(['fancyarrow_dpi_cor_100dpi.png'], remove_text=True,
71-
tol=0 if platform.machine() == 'x86_64' else 0.02,
71+
tol=0.02 if platform.machine() != 'x86_64' else 0,
7272
savefig_kwarg=dict(dpi=100))
7373
def test_fancyarrow_dpi_cor_100dpi():
7474
"""
@@ -83,7 +83,7 @@ def test_fancyarrow_dpi_cor_100dpi():
8383

8484

8585
@image_comparison(['fancyarrow_dpi_cor_200dpi.png'], remove_text=True,
86-
tol=0 if platform.machine() == 'x86_64' else 0.02,
86+
tol=0.02 if platform.machine() != 'x86_64' else 0,
8787
savefig_kwarg=dict(dpi=200))
8888
def test_fancyarrow_dpi_cor_200dpi():
8989
"""
@@ -116,7 +116,7 @@ def test_fancyarrow_dash():
116116

117117

118118
@image_comparison(['arrow_styles.png'], style='mpl20', remove_text=True,
119-
tol=0 if platform.machine() == 'x86_64' else 0.02)
119+
tol=0.02 if platform.machine() != 'x86_64' else 0)
120120
def test_arrow_styles():
121121
styles = mpatches.ArrowStyle.get_styles()
122122

@@ -149,7 +149,7 @@ def test_arrow_styles():
149149

150150

151151
@image_comparison(['connection_styles.png'], style='mpl20', remove_text=True,
152-
tol=0.013 if platform.machine() == 'arm64' else 0)
152+
tol=0.013 if platform.machine() != 'x86_64' else 0)
153153
def test_connection_styles():
154154
styles = mpatches.ConnectionStyle.get_styles()
155155

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+20-23Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def test_matshow(fig_test, fig_ref):
243243
'formatter_ticker_004',
244244
'formatter_ticker_005',
245245
],
246-
tol=0.031 if platform.machine() == 'arm64' else 0)
246+
tol=0.031 if platform.machine() != 'x86_64' else 0)
247247
def test_formatter_ticker():
248248
import matplotlib.testing.jpl_units as units
249249
units.register()
@@ -444,7 +444,7 @@ def test_twin_logscale(fig_test, fig_ref, twin):
444444

445445

446446
@image_comparison(['twin_autoscale.png'],
447-
tol=0.009 if platform.machine() == 'arm64' else 0)
447+
tol=0.009 if platform.machine() != 'x86_64' else 0)
448448
def test_twinx_axis_scales():
449449
x = np.array([0, 0.5, 1])
450450
y = 0.5 * x
@@ -1218,9 +1218,8 @@ def test_imshow():
12181218
ax.imshow("r", data=data)
12191219

12201220

1221-
@image_comparison(
1222-
['imshow_clip'], style='mpl20',
1223-
tol=1.24 if platform.machine() in ('aarch64', 'arm64', 'ppc64le', 's390x') else 0)
1221+
@image_comparison(['imshow_clip'], style='mpl20',
1222+
tol=1.24 if platform.machine() != 'x86_64' else 0)
12241223
def test_imshow_clip():
12251224
# As originally reported by Gellule Xg <gellule.xg@free.fr>
12261225
# use former defaults to match existing baseline image
@@ -1299,7 +1298,7 @@ def test_fill_betweenx_input(y, x1, x2):
12991298

13001299

13011300
@image_comparison(['fill_between_interpolate'], remove_text=True,
1302-
tol=0.012 if platform.machine() == 'arm64' else 0)
1301+
tol=0.012 if platform.machine() != 'x86_64' else 0)
13031302
def test_fill_between_interpolate():
13041303
x = np.arange(0.0, 2, 0.02)
13051304
y1 = np.sin(2*np.pi*x)
@@ -1728,7 +1727,8 @@ def test_pcolorauto(fig_test, fig_ref, snap):
17281727
ax.pcolormesh(x2, y2, Z, snap=snap)
17291728

17301729

1731-
@image_comparison(['canonical'], tol=0.02 if platform.machine() == 'arm64' else 0)
1730+
@image_comparison(['canonical'],
1731+
tol=0.02 if platform.machine() != 'x86_64' else 0)
17321732
def test_canonical():
17331733
fig, ax = plt.subplots()
17341734
ax.plot([1, 2, 3])
@@ -2653,9 +2653,8 @@ def test_contour_hatching():
26532653
extend='both', alpha=0.5)
26542654

26552655

2656-
@image_comparison(
2657-
['contour_colorbar'], style='mpl20',
2658-
tol=0.54 if platform.machine() in ('aarch64', 'arm64', 'ppc64le', 's390x') else 0)
2656+
@image_comparison(['contour_colorbar'], style='mpl20',
2657+
tol=0.54 if platform.machine() != 'x86_64' else 0)
26592658
def test_contour_colorbar():
26602659
x, y, z = contour_dat()
26612660

@@ -3233,7 +3232,7 @@ def test_log_scales_invalid():
32333232

32343233

32353234
@image_comparison(['stackplot_test_image', 'stackplot_test_image'],
3236-
tol=0.031 if platform.machine() == 'arm64' else 0)
3235+
tol=0.031 if platform.machine() != 'x86_64' else 0)
32373236
def test_stackplot():
32383237
fig = plt.figure()
32393238
x = np.linspace(0, 10, 10)
@@ -5127,7 +5126,7 @@ def test_marker_styles():
51275126

51285127

51295128
@image_comparison(['rc_markerfill.png'],
5130-
tol=0.037 if platform.machine() == 'arm64' else 0)
5129+
tol=0.037 if platform.machine() != 'x86_64' else 0)
51315130
def test_markers_fillstyle_rcparams():
51325131
fig, ax = plt.subplots()
51335132
x = np.arange(7)
@@ -5150,7 +5149,7 @@ def test_vertex_markers():
51505149

51515150

51525151
@image_comparison(['vline_hline_zorder', 'errorbar_zorder'],
5153-
tol=0 if platform.machine() == 'x86_64' else 0.026)
5152+
tol=0.026 if platform.machine() != 'x86_64' else 0)
51545153
def test_eb_line_zorder():
51555154
x = list(range(10))
51565155

@@ -5710,7 +5709,7 @@ def test_twin_remove(fig_test, fig_ref):
57105709

57115710

57125711
@image_comparison(['twin_spines.png'], remove_text=True,
5713-
tol=0.022 if platform.machine() == 'arm64' else 0)
5712+
tol=0.022 if platform.machine() != 'x86_64' else 0)
57145713
def test_twin_spines():
57155714

57165715
def make_patch_spines_invisible(ax):
@@ -6307,7 +6306,7 @@ def test_pie_hatch_multi(fig_test, fig_ref):
63076306

63086307

63096308
@image_comparison(['set_get_ticklabels.png'],
6310-
tol=0.025 if platform.machine() == 'arm64' else 0)
6309+
tol=0.025 if platform.machine() != 'x86_64' else 0)
63116310
def test_set_get_ticklabels():
63126311
# test issue 2246
63136312
fig, ax = plt.subplots(2)
@@ -6900,7 +6899,7 @@ def test_loglog():
69006899

69016900

69026901
@image_comparison(["test_loglog_nonpos.png"], remove_text=True, style='mpl20',
6903-
tol=0.029 if platform.machine() == 'arm64' else 0)
6902+
tol=0.029 if platform.machine() != 'x86_64' else 0)
69046903
def test_loglog_nonpos():
69056904
fig, axs = plt.subplots(3, 3)
69066905
x = np.arange(1, 11)
@@ -7869,7 +7868,7 @@ def test_scatter_empty_data():
78697868

78707869

78717870
@image_comparison(['annotate_across_transforms.png'], style='mpl20', remove_text=True,
7872-
tol=0.025 if platform.machine() == 'arm64' else 0)
7871+
tol=0.025 if platform.machine() != 'x86_64' else 0)
78737872
def test_annotate_across_transforms():
78747873
x = np.linspace(0, 10, 200)
78757874
y = np.exp(-x) * np.sin(x)
@@ -7900,7 +7899,7 @@ def inverted(self):
79007899

79017900

79027901
@image_comparison(['secondary_xy.png'], style='mpl20',
7903-
tol=0.027 if platform.machine() == 'arm64' else 0)
7902+
tol=0.027 if platform.machine() != 'x86_64' else 0)
79047903
def test_secondary_xy():
79057904
fig, axs = plt.subplots(1, 2, figsize=(10, 5), constrained_layout=True)
79067905

@@ -9163,10 +9162,8 @@ def test_zorder_and_explicit_rasterization():
91639162
fig.savefig(b, format='pdf')
91649163

91659164

9166-
@image_comparison(
9167-
["preset_clip_paths.png"],
9168-
remove_text=True, style="mpl20",
9169-
tol=0.027 if platform.machine() in ("aarch64", "arm64", "ppc64le") else 0)
9165+
@image_comparison(["preset_clip_paths.png"], remove_text=True, style="mpl20",
9166+
tol=0.027 if platform.machine() != 'x86_64' else 0)
91709167
def test_preset_clip_paths():
91719168
fig, ax = plt.subplots()
91729169

@@ -9500,7 +9497,7 @@ def test_boxplot_orientation(fig_test, fig_ref):
95009497

95019498

95029499
@image_comparison(["use_colorizer_keyword.png"],
9503-
tol=0.05 if platform.machine() == 'arm64' else 0)
9500+
tol=0.05 if platform.machine() != 'x86_64' else 0)
95049501
def test_use_colorizer_keyword():
95059502
# test using the colorizer keyword
95069503
np.random.seed(0)

‎lib/matplotlib/tests/test_bbox_tight.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_bbox_tight.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_bbox_inches_tight():
4646

4747
@image_comparison(['bbox_inches_tight_suptile_legend'],
4848
savefig_kwarg={'bbox_inches': 'tight'},
49-
tol=0.02 if platform.machine() == 'arm64' else 0)
49+
tol=0.02 if platform.machine() != 'x86_64' else 0)
5050
def test_bbox_inches_tight_suptile_legend():
5151
plt.plot(np.arange(10), label='a straight line')
5252
plt.legend(bbox_to_anchor=(0.9, 1), loc='upper left')

‎lib/matplotlib/tests/test_collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_collections.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def test_barb_limits():
391391

392392

393393
@image_comparison(['EllipseCollection_test_image.png'], remove_text=True,
394-
tol=0.021 if platform.machine() == 'arm64' else 0)
394+
tol=0.021 if platform.machine() != 'x86_64' else 0)
395395
def test_EllipseCollection():
396396
# Test basic functionality
397397
fig, ax = plt.subplots()

‎lib/matplotlib/tests/test_colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_colorbar.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_colorbar_single_ax_panchor_east(constrained):
235235

236236

237237
@image_comparison(['contour_colorbar.png'], remove_text=True,
238-
tol=0 if platform.machine() == 'x86_64' else 0.054)
238+
tol=0.054 if platform.machine() != 'x86_64' else 0)
239239
def test_contour_colorbar():
240240
fig, ax = plt.subplots(figsize=(4, 2))
241241
data = np.arange(1200).reshape(30, 40) - 500

‎lib/matplotlib/tests/test_constrainedlayout.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_constrainedlayout.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def test_constrained_layout9():
198198

199199

200200
@image_comparison(['constrained_layout10.png'],
201-
tol=0.032 if platform.machine() == 'arm64' else 0)
201+
tol=0.032 if platform.machine() != 'x86_64' else 0)
202202
def test_constrained_layout10():
203203
"""Test for handling legend outside axis"""
204204
fig, axs = plt.subplots(2, 2, layout="constrained")

‎lib/matplotlib/tests/test_contour.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_contour.py
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def test_contour_label_with_disconnected_segments():
140140

141141

142142
@image_comparison(['contour_manual_colors_and_levels.png'], remove_text=True,
143-
tol=0.018 if platform.machine() == 'arm64' else 0)
143+
tol=0.018 if platform.machine() != 'x86_64' else 0)
144144
def test_given_colors_levels_and_extends():
145145
# Remove this line when this test image is regenerated.
146146
plt.rcParams['pcolormesh.snap'] = False
@@ -416,10 +416,8 @@ def test_contourf_log_extension():
416416
cb = plt.colorbar(c3, ax=ax3)
417417

418418

419-
@image_comparison(
420-
['contour_addlines.png'], remove_text=True, style='mpl20',
421-
tol=0.15 if platform.machine() in ('aarch64', 'arm64', 'ppc64le', 's390x')
422-
else 0.03)
419+
@image_comparison(['contour_addlines.png'], remove_text=True, style='mpl20',
420+
tol=0.15 if platform.machine() != 'x86_64' else 0.03)
423421
# tolerance is because image changed minutely when tick finding on
424422
# colorbars was cleaned up...
425423
def test_contour_addlines():

‎lib/matplotlib/tests/test_figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_figure.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
@image_comparison(['figure_align_labels'], extensions=['png', 'svg'],
29-
tol=0 if platform.machine() == 'x86_64' else 0.01)
29+
tol=0.01 if platform.machine() != 'x86_64' else 0)
3030
def test_align_labels():
3131
fig = plt.figure(layout='tight')
3232
gs = gridspec.GridSpec(3, 3)
@@ -68,7 +68,7 @@ def test_align_labels():
6868

6969
@image_comparison(['figure_align_titles_tight.png',
7070
'figure_align_titles_constrained.png'],
71-
tol=0 if platform.machine() == 'x86_64' else 0.022,
71+
tol=0.022 if platform.machine() != 'x86_64' else 0,
7272
style='mpl20')
7373
def test_align_titles():
7474
for layout in ['tight', 'constrained']:
@@ -210,7 +210,7 @@ def test_clf_keyword():
210210

211211

212212
@image_comparison(['figure_today'],
213-
tol=0.015 if platform.machine() == 'arm64' else 0)
213+
tol=0.015 if platform.machine() != 'x86_64' else 0)
214214
def test_figure():
215215
# named figure support
216216
fig = plt.figure('today')

‎lib/matplotlib/tests/test_image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_image.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ def test_imshow_endianess():
925925

926926

927927
@image_comparison(['imshow_masked_interpolation'],
928-
tol=0 if platform.machine() == 'x86_64' else 0.01,
928+
tol=0.01 if platform.machine() != 'x86_64' else 0,
929929
remove_text=True, style='mpl20')
930930
def test_imshow_masked_interpolation():
931931

‎lib/matplotlib/tests/test_legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_legend.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def test_various_labels():
140140

141141

142142
@image_comparison(['legend_labels_first.png'], remove_text=True,
143-
tol=0.013 if platform.machine() == 'arm64' else 0)
143+
tol=0.013 if platform.machine() != 'x86_64' else 0)
144144
def test_labels_first():
145145
# test labels to left of markers
146146
fig, ax = plt.subplots()
@@ -151,7 +151,7 @@ def test_labels_first():
151151

152152

153153
@image_comparison(['legend_multiple_keys.png'], remove_text=True,
154-
tol=0.013 if platform.machine() == 'arm64' else 0)
154+
tol=0.013 if platform.machine() != 'x86_64' else 0)
155155
def test_multiple_keys():
156156
# test legend entries with multiple keys
157157
fig, ax = plt.subplots()
@@ -165,7 +165,7 @@ def test_multiple_keys():
165165

166166

167167
@image_comparison(['rgba_alpha.png'], remove_text=True,
168-
tol=0 if platform.machine() == 'x86_64' else 0.03)
168+
tol=0.03 if platform.machine() != 'x86_64' else 0)
169169
def test_alpha_rgba():
170170
fig, ax = plt.subplots()
171171
ax.plot(range(10), lw=5)
@@ -174,7 +174,7 @@ def test_alpha_rgba():
174174

175175

176176
@image_comparison(['rcparam_alpha.png'], remove_text=True,
177-
tol=0 if platform.machine() == 'x86_64' else 0.03)
177+
tol=0.03 if platform.machine() != 'x86_64' else 0)
178178
def test_alpha_rcparam():
179179
fig, ax = plt.subplots()
180180
ax.plot(range(10), lw=5)
@@ -202,7 +202,7 @@ def test_fancy():
202202

203203

204204
@image_comparison(['framealpha'], remove_text=True,
205-
tol=0 if platform.machine() == 'x86_64' else 0.024)
205+
tol=0.024 if platform.machine() != 'x86_64' else 0)
206206
def test_framealpha():
207207
x = np.linspace(1, 100, 100)
208208
y = x
@@ -514,7 +514,7 @@ def test_figure_legend_outside():
514514

515515

516516
@image_comparison(['legend_stackplot.png'],
517-
tol=0.031 if platform.machine() == 'arm64' else 0)
517+
tol=0.031 if platform.machine() != 'x86_64' else 0)
518518
def test_legend_stackplot():
519519
"""Test legend for PolyCollection using stackplot."""
520520
# related to #1341, #1943, and PR #3303
@@ -650,7 +650,7 @@ def test_empty_bar_chart_with_legend():
650650

651651

652652
@image_comparison(['shadow_argument_types.png'], remove_text=True, style='mpl20',
653-
tol=0.028 if platform.machine() == 'arm64' else 0)
653+
tol=0.028 if platform.machine() != 'x86_64' else 0)
654654
def test_shadow_argument_types():
655655
# Test that different arguments for shadow work as expected
656656
fig, ax = plt.subplots()

‎lib/matplotlib/tests/test_lines.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_lines.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def test_valid_linestyles():
140140

141141

142142
@image_comparison(['drawstyle_variants.png'], remove_text=True,
143-
tol=0.03 if platform.machine() == 'arm64' else 0)
143+
tol=0.03 if platform.machine() != 'x86_64' else 0)
144144
def test_drawstyle_variants():
145145
fig, axs = plt.subplots(6)
146146
dss = ["default", "steps-mid", "steps-pre", "steps-post", "steps", None]
@@ -183,9 +183,8 @@ def test_set_drawstyle():
183183
assert len(line.get_path().vertices) == len(x)
184184

185185

186-
@image_comparison(
187-
['line_collection_dashes'], remove_text=True, style='mpl20',
188-
tol=0 if platform.machine() == 'x86_64' else 0.65)
186+
@image_comparison(['line_collection_dashes'], remove_text=True, style='mpl20',
187+
tol=0.65 if platform.machine() != 'x86_64' else 0)
189188
def test_set_line_coll_dash_image():
190189
fig, ax = plt.subplots()
191190
np.random.seed(0)

‎lib/matplotlib/tests/test_patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_patches.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def test_wedge_movement():
438438

439439

440440
@image_comparison(['wedge_range'], remove_text=True,
441-
tol=0.009 if platform.machine() == 'arm64' else 0)
441+
tol=0.009 if platform.machine() != 'x86_64' else 0)
442442
def test_wedge_range():
443443
ax = plt.axes()
444444

@@ -564,7 +564,7 @@ def test_units_rectangle():
564564

565565

566566
@image_comparison(['connection_patch.png'], style='mpl20', remove_text=True,
567-
tol=0.024 if platform.machine() == 'arm64' else 0)
567+
tol=0.024 if platform.machine() != 'x86_64' else 0)
568568
def test_connection_patch():
569569
fig, (ax1, ax2) = plt.subplots(1, 2)
570570

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.