Skip to content

Commit 0b860ac

Browse files
committed
Increase tolerance on more arches
1 parent ac77fea commit 0b860ac

18 files changed

+36
-35
lines changed

lib/matplotlib/tests/test_arrow_patches.py

Lines changed: 2 additions & 2 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() in {'aarch64', 'arm64'} 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]
@@ -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() in {'aarch64', 'arm64'} else 0)
153153
def test_connection_styles():
154154
styles = mpatches.ConnectionStyle.get_styles()
155155

lib/matplotlib/tests/test_axes.py

Lines changed: 13 additions & 12 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() in {'aarch64', 'arm64'} 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() in {'aarch64', 'arm64'} else 0)
448448
def test_twinx_axis_scales():
449449
x = np.array([0, 0.5, 1])
450450
y = 0.5 * x
@@ -1299,7 +1299,7 @@ def test_fill_betweenx_input(y, x1, x2):
12991299

13001300

13011301
@image_comparison(['fill_between_interpolate'], remove_text=True,
1302-
tol=0.012 if platform.machine() == 'arm64' else 0)
1302+
tol=0.012 if platform.machine() == {'aarch64', 'arm64'} else 0)
13031303
def test_fill_between_interpolate():
13041304
x = np.arange(0.0, 2, 0.02)
13051305
y1 = np.sin(2*np.pi*x)
@@ -1728,7 +1728,8 @@ def test_pcolorauto(fig_test, fig_ref, snap):
17281728
ax.pcolormesh(x2, y2, Z, snap=snap)
17291729

17301730

1731-
@image_comparison(['canonical'], tol=0.02 if platform.machine() == 'arm64' else 0)
1731+
@image_comparison(['canonical'],
1732+
tol=0.02 if platform.machine() in {'aarch64', 'arm64'} else 0)
17321733
def test_canonical():
17331734
fig, ax = plt.subplots()
17341735
ax.plot([1, 2, 3])
@@ -3233,7 +3234,7 @@ def test_log_scales_invalid():
32333234

32343235

32353236
@image_comparison(['stackplot_test_image', 'stackplot_test_image'],
3236-
tol=0.031 if platform.machine() == 'arm64' else 0)
3237+
tol=0.031 if platform.machine() in {'aarch64', 'arm64'} else 0)
32373238
def test_stackplot():
32383239
fig = plt.figure()
32393240
x = np.linspace(0, 10, 10)
@@ -5127,7 +5128,7 @@ def test_marker_styles():
51275128

51285129

51295130
@image_comparison(['rc_markerfill.png'],
5130-
tol=0.037 if platform.machine() == 'arm64' else 0)
5131+
tol=0.037 if platform.machine() in {'aarch64', 'arm64'} else 0)
51315132
def test_markers_fillstyle_rcparams():
51325133
fig, ax = plt.subplots()
51335134
x = np.arange(7)
@@ -5710,7 +5711,7 @@ def test_twin_remove(fig_test, fig_ref):
57105711

57115712

57125713
@image_comparison(['twin_spines.png'], remove_text=True,
5713-
tol=0.022 if platform.machine() == 'arm64' else 0)
5714+
tol=0.022 if platform.machine() in {'aarch64', 'arm64'} else 0)
57145715
def test_twin_spines():
57155716

57165717
def make_patch_spines_invisible(ax):
@@ -6307,7 +6308,7 @@ def test_pie_hatch_multi(fig_test, fig_ref):
63076308

63086309

63096310
@image_comparison(['set_get_ticklabels.png'],
6310-
tol=0.025 if platform.machine() == 'arm64' else 0)
6311+
tol=0.025 if platform.machine() in {'aarch64', 'arm64'} else 0)
63116312
def test_set_get_ticklabels():
63126313
# test issue 2246
63136314
fig, ax = plt.subplots(2)
@@ -6900,7 +6901,7 @@ def test_loglog():
69006901

69016902

69026903
@image_comparison(["test_loglog_nonpos.png"], remove_text=True, style='mpl20',
6903-
tol=0.029 if platform.machine() == 'arm64' else 0)
6904+
tol=0.029 if platform.machine() in {'aarch64', 'arm64'} else 0)
69046905
def test_loglog_nonpos():
69056906
fig, axs = plt.subplots(3, 3)
69066907
x = np.arange(1, 11)
@@ -7900,7 +7901,7 @@ def inverted(self):
79007901

79017902

79027903
@image_comparison(['secondary_xy.png'], style='mpl20',
7903-
tol=0.027 if platform.machine() == 'arm64' else 0)
7904+
tol=0.027 if platform.machine() in {'aarch64', 'arm64'} else 0)
79047905
def test_secondary_xy():
79057906
fig, axs = plt.subplots(1, 2, figsize=(10, 5), constrained_layout=True)
79067907

@@ -9166,7 +9167,7 @@ def test_zorder_and_explicit_rasterization():
91669167
@image_comparison(
91679168
["preset_clip_paths.png"],
91689169
remove_text=True, style="mpl20",
9169-
tol=0.027 if platform.machine() in ("aarch64", "arm64", "ppc64le") else 0)
9170+
tol=0.027 if platform.machine() in {"aarch64", "arm64", "ppc64le"} else 0)
91709171
def test_preset_clip_paths():
91719172
fig, ax = plt.subplots()
91729173

@@ -9500,7 +9501,7 @@ def test_boxplot_orientation(fig_test, fig_ref):
95009501

95019502

95029503
@image_comparison(["use_colorizer_keyword.png"],
9503-
tol=0.05 if platform.machine() == 'arm64' else 0)
9504+
tol=0.05 if platform.machine() in {'aarch64', 'arm64'} else 0)
95049505
def test_use_colorizer_keyword():
95059506
# test using the colorizer keyword
95069507
np.random.seed(0)

lib/matplotlib/tests/test_bbox_tight.py

Lines 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() in {'aarch64', 'arm64'} 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

Lines 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() in {'aarch64', 'arm64'} else 0)
395395
def test_EllipseCollection():
396396
# Test basic functionality
397397
fig, ax = plt.subplots()

lib/matplotlib/tests/test_constrainedlayout.py

Lines 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() in {'aarch64', 'arm64'} 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

Lines changed: 1 addition & 1 deletion
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() in {'aarch64', 'arm64'} 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

lib/matplotlib/tests/test_figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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() in {'aarch64', 'arm64'} else 0)
214214
def test_figure():
215215
# named figure support
216216
fig = plt.figure('today')

lib/matplotlib/tests/test_legend.py

Lines changed: 4 additions & 4 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() in {'aarch64', 'arm64'} 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() in {'aarch64', 'arm64'} else 0)
155155
def test_multiple_keys():
156156
# test legend entries with multiple keys
157157
fig, ax = plt.subplots()
@@ -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() in {'aarch64', 'arm64'} 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() in {'aarch64', 'arm64'} 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

Lines changed: 1 addition & 1 deletion
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() in {'aarch64', 'arm64'} else 0)
144144
def test_drawstyle_variants():
145145
fig, axs = plt.subplots(6)
146146
dss = ["default", "steps-mid", "steps-pre", "steps-post", "steps", None]

lib/matplotlib/tests/test_patches.py

Lines changed: 1 addition & 1 deletion
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() in {'aarch64', 'arm64'} else 0)
442442
def test_wedge_range():
443443
ax = plt.axes()
444444

lib/matplotlib/tests/test_path.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_nonlinear_containment():
151151

152152

153153
@image_comparison(['arrow_contains_point.png'], remove_text=True, style='mpl20',
154-
tol=0.027 if platform.machine() == 'arm64' else 0)
154+
tol=0.027 if platform.machine() in {'aarch64', 'arm64'} else 0)
155155
def test_arrow_contains_point():
156156
# fix bug (#8384)
157157
fig, ax = plt.subplots()
@@ -283,7 +283,7 @@ def test_marker_paths_pdf():
283283

284284
@image_comparison(['nan_path'], style='default', remove_text=True,
285285
extensions=['pdf', 'svg', 'eps', 'png'],
286-
tol=0.009 if platform.machine() == 'arm64' else 0)
286+
tol=0.009 if platform.machine() in {'aarch64', 'arm64'} else 0)
287287
def test_nan_isolated_points():
288288

289289
y0 = [0, np.nan, 2, np.nan, 4, 5, 6]

lib/matplotlib/tests/test_patheffects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_patheffect1():
3030

3131

3232
@image_comparison(['patheffect2'], remove_text=True, style='mpl20',
33-
tol=0.06 if platform.machine() == 'arm64' else 0)
33+
tol=0.06 if platform.machine() in {'aarch64', 'arm64'} else 0)
3434
def test_patheffect2():
3535

3636
ax2 = plt.subplot()
@@ -45,7 +45,7 @@ def test_patheffect2():
4545
foreground="w")])
4646

4747

48-
@image_comparison(['patheffect3'], tol=0.019 if platform.machine() == 'arm64' else 0)
48+
@image_comparison(['patheffect3'], tol=0.019 if platform.machine() in {'aarch64', 'arm64'} else 0)
4949
def test_patheffect3():
5050
p1, = plt.plot([1, 3, 5, 4, 3], 'o-b', lw=4)
5151
p1.set_path_effects([path_effects.SimpleLineShadow(),

lib/matplotlib/tests/test_simplification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_clipping():
2929

3030

3131
@image_comparison(['overflow'], remove_text=True,
32-
tol=0.007 if platform.machine() == 'arm64' else 0)
32+
tol=0.007 if platform.machine() in {'aarch64', 'arm64'} else 0)
3333
def test_overflow():
3434
x = np.array([1.0, 2.0, 3.0, 2.0e5])
3535
y = np.arange(len(x))

lib/matplotlib/tests/test_skew.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_set_line_coll_dash_image():
146146

147147

148148
@image_comparison(['skew_rects'], remove_text=True,
149-
tol=0.009 if platform.machine() == 'arm64' else 0)
149+
tol=0.009 if platform.machine() in {'aarch64', 'arm64'} else 0)
150150
def test_skew_rectangle():
151151

152152
fix, axes = plt.subplots(5, 5, sharex=True, sharey=True, figsize=(8, 8))

lib/matplotlib/tests/test_subplots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def test_exceptions():
175175

176176

177177
@image_comparison(['subplots_offset_text'],
178-
tol=0.028 if platform.machine() == 'arm64' else 0)
178+
tol=0.028 if platform.machine() in {'aarch64', 'arm64'} else 0)
179179
def test_subplots_offsettext():
180180
x = np.arange(0, 1e10, 1e9)
181181
y = np.arange(0, 100, 10)+1e4

lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def test_fill_facecolor():
346346
# Update style when regenerating the test image
347347
@image_comparison(['zoomed_axes.png', 'inverted_zoomed_axes.png'],
348348
style=('classic', '_classic_test_patch'),
349-
tol=0.02 if platform.machine() == 'arm64' else 0)
349+
tol=0.02 if platform.machine() in {'aarch64', 'arm64'} else 0)
350350
def test_zooming_with_inverted_axes():
351351
fig, ax = plt.subplots()
352352
ax.plot([1, 2, 3], [1, 2, 3])

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ def test_errorbar3d_errorevery():
17211721

17221722

17231723
@mpl3d_image_comparison(['errorbar3d.png'], style='mpl20',
1724-
tol=0.02 if platform.machine() == 'arm64' else 0)
1724+
tol=0.02 if platform.machine() in {'aarch64', 'arm64'} else 0)
17251725
def test_errorbar3d():
17261726
"""Tests limits, color styling, and legend for 3D errorbars."""
17271727
fig = plt.figure()

lib/mpl_toolkits/mplot3d/tests/test_legend3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_legend_bar():
2828

2929

3030
@image_comparison(['fancy.png'], remove_text=True, style='mpl20',
31-
tol=0.011 if platform.machine() == 'arm64' else 0)
31+
tol=0.011 if platform.machine() in {'aarch64', 'arm64'} else 0)
3232
def test_fancy():
3333
fig, ax = plt.subplots(subplot_kw=dict(projection='3d'))
3434
ax.plot(np.arange(10), np.full(10, 5), np.full(10, 5), 'o--', label='line')

0 commit comments

Comments
 (0)