Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST: Restore some tolerances for some arch/platform-specific failures
The tolerances on these were increased in various PRs, with notes to
reduce/remove them, so they were removed in #30184, but should have been
reverted to a smaller value:

- `test_floating_axes.py::test_curvelinear4[png]` fails on macOS
- `test_grid_helper_curvelinear.py::test_axis_direction[png]` fails on
  ARM and macOS
- `test_grid_helper_curvelinear.py::test_polar_box[png]` fails on
  Windows, ARM, and macOS

These fail on macOS; there's tolerances on them already, they fail by
just a small amount, so increase them:

- `test_bbox_tight.py::test_bbox_inches_tight_suptile_legend[png]`
- `test_patheffects.py::test_collection[png]`
- `test_axes3d.py::test_scale3d_artists_log[png]`

This fails only on AppVeyor (Windows), but not Azure. There is a
tolerance there already, so just add it to the list:

- `test_mathtext.py::test_mathtext_rendering`
  • Loading branch information
QuLogic committed Mar 27, 2026
commit 573764e43a8a4ed7621d2c4a287b9a5b8d009be9
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_bbox_tight.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_bbox_inches_tight(text_placeholders):

@image_comparison(['bbox_inches_tight_suptile_legend'],
savefig_kwarg={'bbox_inches': 'tight'},
tol=0 if platform.machine() == 'x86_64' else 0.022)
tol=0 if platform.machine() == 'x86_64' else 0.024)
def test_bbox_inches_tight_suptile_legend():
plt.plot(np.arange(10), label='a straight line')
plt.legend(bbox_to_anchor=(0.9, 1), loc='upper left')
Expand Down
7 changes: 5 additions & 2 deletions lib/matplotlib/tests/test_mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,11 @@ def baseline_images(request, fontset, index, text):
@pytest.mark.parametrize(
'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif'])
@pytest.mark.parametrize('baseline_images', ['mathtext'], indirect=True)
@image_comparison(baseline_images=None, style='mpl20',
tol=0.011 if platform.machine() in ('ppc64le', 's390x') else 0)
@image_comparison(
baseline_images=None, style='mpl20',
tol=(0.013
if platform.machine() in ('ppc64le', 's390x') or platform.system() == 'Windows'
else 0))
def test_mathtext_rendering(baseline_images, fontset, index, text):
mpl.rcParams['mathtext.fontset'] = fontset
fig = plt.figure(figsize=(5.25, 0.75))
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_patheffects.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_SimplePatchShadow_offset():
assert pe._offset == (4, 5)


@image_comparison(['collection'], tol=0.03, style='mpl20')
@image_comparison(['collection'], tol=0.032, style='mpl20')
def test_collection():
x, y = np.meshgrid(np.linspace(0, 10, 150), np.linspace(-5, 5, 100))
data = np.sin(x) + np.cos(y)
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/axisartist/tests/test_floating_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_curvelinear3():
l.set_clip_path(ax1.patch)


@image_comparison(['curvelinear4.png'], style='mpl20')
@image_comparison(['curvelinear4.png'], style='mpl20', tol=0.04)
def test_curvelinear4():
fig = plt.figure(figsize=(5, 5))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def inverted(self):
ax1.grid(True)


@image_comparison(['polar_box.png'], style='mpl20')
@image_comparison(['polar_box.png'], style='mpl20', tol=0.04)
def test_polar_box():
plt.rcParams.update({"xtick.direction": "inout", "ytick.direction": "out"})
fig = plt.figure(figsize=(5, 5))
Expand Down Expand Up @@ -138,7 +138,7 @@ def test_polar_box():
ax1.grid(True)


@image_comparison(['axis_direction.png'], style='mpl20')
@image_comparison(['axis_direction.png'], style='mpl20', tol=0.04)
def test_axis_direction():
fig = plt.figure(figsize=(5, 5))

Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/mplot3d/tests/test_axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2878,7 +2878,7 @@ def _make_triangulation_data():


@mpl3d_image_comparison(['scale3d_artists_log.png'], style='mpl20',
remove_text=False, tol=0.03)
remove_text=False, tol=0.032)
def test_scale3d_artists_log():
"""Test all 3D artist types with log scale."""
fig = plt.figure(figsize=(16, 12))
Expand Down