Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69af477

Browse files
committed
TST: Increase tolerance of some tests for aarch64
Some tests differ from expected result on aarch64 by more than the expected tolerance. The generated images however remain visually similar. The differences appear to be at borders of colours for images, i.e. edges of fonts, between transitions of colours, etc. and is possibly due to FP rounding differences at those points. Bump up tolerance of these tests by a wee bit so that they pass on aarch64.
1 parent 330a054 commit 69af477

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import numpy as np
88
import pytest
9+
import platform
910

1011
import matplotlib as mpl
1112
import matplotlib.pyplot as plt
@@ -165,7 +166,8 @@ def test_pathclip():
165166
# test mixed mode rendering
166167
@needs_xelatex
167168
@pytest.mark.backend('pgf')
168-
@image_comparison(['pgf_mixedmode.pdf'], style='default')
169+
@image_comparison(['pgf_mixedmode.pdf'], style='default',
170+
tol={'aarch64': 1.086}.get(platform.machine(), 0.0))
169171
def test_mixedmode():
170172
rc_xelatex = {'font.family': 'serif',
171173
'pgf.rcfonts': False}

lib/matplotlib/tests/test_pickle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_simple():
4040

4141

4242
@image_comparison(['multi_pickle.png'], remove_text=True, style='mpl20',
43-
tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
43+
tol={'aarch64': 0.082}.get(platform.machine(), 0.0))
4444
def test_complete():
4545
fig = plt.figure('Figure with a label?', figsize=(10, 6))
4646

lib/matplotlib/tests/test_usetex.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import platform
23

34
import matplotlib as mpl
45
from matplotlib.testing.decorators import check_figures_equal, image_comparison
@@ -14,7 +15,7 @@ def usetex():
1415

1516
@image_comparison(baseline_images=['test_usetex'],
1617
extensions=['pdf', 'png'],
17-
tol=0.3)
18+
tol={'aarch64': 2.868}.get(platform.machine(), 0.3))
1819
def test_usetex():
1920
fig = plt.figure()
2021
ax = fig.add_subplot(111)

lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
GridHelperCurveLinear
1717

1818

19-
@image_comparison(['custom_transform.png'], style='default', tol=0.03)
19+
@image_comparison(['custom_transform.png'], style='default',
20+
tol={'aarch64': 0.034}.get(platform.machine(), 0.03))
2021
def test_custom_transform():
2122
class MyTransform(Transform):
2223
input_dims = 2

0 commit comments

Comments
 (0)