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 d99722e

Browse filesBrowse files
authored
Merge pull request #11666 from ksunden/aarch64_tests
TESTS: Increase tolerance for aarch64 tests
2 parents ac97e14 + 6f30168 commit d99722e
Copy full SHA for d99722e
Expand file treeCollapse file tree

13 files changed

+38
-6
lines changed

‎lib/matplotlib/tests/test_arrow_patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_arrow_patches.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import platform
23
import matplotlib.pyplot as plt
34
from matplotlib.testing.decorators import image_comparison
45
import matplotlib.patches as mpatches
@@ -68,6 +69,7 @@ def __prepare_fancyarrow_dpi_cor_test():
6869

6970
@image_comparison(baseline_images=['fancyarrow_dpi_cor_100dpi'],
7071
remove_text=True, extensions=['png'],
72+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
7173
savefig_kwarg=dict(dpi=100))
7274
def test_fancyarrow_dpi_cor_100dpi():
7375
"""
@@ -83,6 +85,7 @@ def test_fancyarrow_dpi_cor_100dpi():
8385

8486
@image_comparison(baseline_images=['fancyarrow_dpi_cor_200dpi'],
8587
remove_text=True, extensions=['png'],
88+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
8689
savefig_kwarg=dict(dpi=200))
8790
def test_fancyarrow_dpi_cor_200dpi():
8891
"""

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from itertools import product
22
from distutils.version import LooseVersion
33
import io
4+
import platform
45

56
import datetime
67

@@ -3349,7 +3350,8 @@ def test_vertex_markers():
33493350

33503351

33513352
@image_comparison(baseline_images=['vline_hline_zorder',
3352-
'errorbar_zorder'])
3353+
'errorbar_zorder'],
3354+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
33533355
def test_eb_line_zorder():
33543356
x = list(range(10))
33553357

@@ -5120,7 +5122,8 @@ def test_title_location_roundtrip():
51205122

51215123

51225124
@image_comparison(baseline_images=["loglog"], remove_text=True,
5123-
extensions=['png'])
5125+
extensions=['png'],
5126+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
51245127
def test_loglog():
51255128
fig, ax = plt.subplots()
51265129
x = np.arange(1, 11)

‎lib/matplotlib/tests/test_collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_collections.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Tests specific to the collections module.
33
"""
44
import io
5+
import platform
56

67
import numpy as np
78
from numpy.testing import assert_array_equal, assert_array_almost_equal
@@ -441,6 +442,7 @@ def test_barb_limits():
441442

442443
@image_comparison(baseline_images=['EllipseCollection_test_image'],
443444
extensions=['png'],
445+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
444446
remove_text=True)
445447
def test_EllipseCollection():
446448
# Test basic functionality

‎lib/matplotlib/tests/test_cycles.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_cycles.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import warnings
2+
import platform
23

34
from matplotlib.testing.decorators import image_comparison
45
import matplotlib.pyplot as plt
@@ -9,6 +10,7 @@
910

1011

1112
@image_comparison(baseline_images=['color_cycle_basic'], remove_text=True,
13+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
1214
extensions=['png'])
1315
def test_colorcycle_basic():
1416
fig, ax = plt.subplots()
@@ -26,6 +28,7 @@ def test_colorcycle_basic():
2628

2729

2830
@image_comparison(baseline_images=['marker_cycle', 'marker_cycle'],
31+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
2932
remove_text=True, extensions=['png'])
3033
def test_marker_cycle():
3134
fig, ax = plt.subplots()
@@ -59,6 +62,7 @@ def test_marker_cycle():
5962

6063

6164
@image_comparison(baseline_images=['lineprop_cycle_basic'], remove_text=True,
65+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
6266
extensions=['png'])
6367
def test_linestylecycle_basic():
6468
fig, ax = plt.subplots()

‎lib/matplotlib/tests/test_figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_figure.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
import warnings
3+
import platform
34

45
from matplotlib import rcParams
56
from matplotlib.testing.decorators import image_comparison
@@ -12,7 +13,8 @@
1213
import pytest
1314

1415

15-
@image_comparison(baseline_images=['figure_align_labels'])
16+
@image_comparison(baseline_images=['figure_align_labels'],
17+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
1618
def test_align_labels():
1719
# Check the figure.align_labels() command
1820
fig = plt.figure(tight_layout=True)

‎lib/matplotlib/tests/test_image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_image.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import io
33
import os
44
import sys
5+
import platform
56
import urllib.request
67
import warnings
78

@@ -762,6 +763,7 @@ def test_imshow_endianess():
762763

763764

764765
@image_comparison(baseline_images=['imshow_masked_interpolation'],
766+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
765767
remove_text=True, style='mpl20')
766768
def test_imshow_masked_interpolation():
767769

‎lib/matplotlib/tests/test_legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_legend.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import collections
22
import inspect
3+
import platform
34
from unittest import mock
45

56
import numpy as np
@@ -107,6 +108,7 @@ def test_multiple_keys():
107108

108109

109110
@image_comparison(baseline_images=['rgba_alpha'],
111+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
110112
extensions=['png'], remove_text=True)
111113
def test_alpha_rgba():
112114
import matplotlib.pyplot as plt
@@ -118,6 +120,7 @@ def test_alpha_rgba():
118120

119121

120122
@image_comparison(baseline_images=['rcparam_alpha'],
123+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
121124
extensions=['png'], remove_text=True)
122125
def test_alpha_rcparam():
123126
import matplotlib.pyplot as plt
@@ -145,7 +148,8 @@ def test_fancy():
145148
ncol=2, shadow=True, title="My legend", numpoints=1)
146149

147150

148-
@image_comparison(baseline_images=['framealpha'], remove_text=True)
151+
@image_comparison(baseline_images=['framealpha'], remove_text=True,
152+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
149153
def test_framealpha():
150154
x = np.linspace(1, 100, 100)
151155
y = x

‎lib/matplotlib/tests/test_pickle.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_pickle.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pickle
2+
import platform
23
from io import BytesIO
34

45
import numpy as np
@@ -43,6 +44,7 @@ def test_simple():
4344

4445
@image_comparison(baseline_images=['multi_pickle'],
4546
extensions=['png'], remove_text=True,
47+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
4648
style='mpl20')
4749
def test_complete():
4850
fig = plt.figure('Figure with a label?', figsize=(10, 6))

‎lib/matplotlib/tests/test_scale.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_scale.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from matplotlib.scale import Log10Transform, InvertedLog10Transform
44
import numpy as np
55
import io
6+
import platform
67
import pytest
78

89

@@ -98,6 +99,7 @@ def test_logscale_transform_repr():
9899

99100

100101
@image_comparison(baseline_images=['logscale_nonpos_values'], remove_text=True,
102+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
101103
extensions=['png'], style='mpl20')
102104
def test_logscale_nonpos_values():
103105
np.random.seed(19680801)

‎lib/matplotlib/tests/test_streamplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_streamplot.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import platform
23

34
import numpy as np
45
from numpy.testing import assert_array_almost_equal
@@ -48,6 +49,7 @@ def test_colormap():
4849

4950

5051
@image_comparison(baseline_images=['streamplot_linewidth'],
52+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
5153
remove_text=True, style='mpl20')
5254
def test_linewidth():
5355
X, Y, U, V = velocity_field()

‎lib/matplotlib/tests/test_units.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_units.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import datetime
21
from unittest.mock import MagicMock
32

43
from matplotlib.cbook import iterable
@@ -7,6 +6,7 @@
76
import matplotlib.units as munits
87
import numpy as np
98
import datetime
9+
import platform
1010

1111

1212
# Basic class that wraps numpy array and has units
@@ -41,6 +41,7 @@ def __array__(self):
4141
# Tests that the conversion machinery works properly for classes that
4242
# work as a facade over numpy arrays (like pint)
4343
@image_comparison(baseline_images=['plot_pint'],
44+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
4445
extensions=['png'], remove_text=False, style='mpl20')
4546
def test_numpy_facade():
4647
# Create an instance of the conversion interface and
@@ -85,6 +86,7 @@ def convert(value, unit, axis):
8586

8687
# Tests gh-8908
8788
@image_comparison(baseline_images=['plot_masked_units'],
89+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
8890
extensions=['png'], remove_text=True, style='mpl20')
8991
def test_plot_masked_units():
9092
data = np.linspace(-5, 5)

‎lib/mpl_toolkits/tests/test_axes_grid1.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_axes_grid1.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from itertools import product
2222

2323
import pytest
24+
import platform
2425

2526
import numpy as np
2627
from numpy.testing import assert_array_equal, assert_array_almost_equal
@@ -358,6 +359,7 @@ def test_zooming_with_inverted_axes():
358359

359360

360361
@image_comparison(baseline_images=['anchored_direction_arrows'],
362+
tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
361363
extensions=['png'])
362364
def test_anchored_direction_arrows():
363365
fig, ax = plt.subplots()

‎lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import numpy as np
2+
import platform
23

34
import matplotlib.pyplot as plt
45
from matplotlib.path import Path
@@ -84,7 +85,8 @@ def inverted(self):
8485

8586

8687
@image_comparison(baseline_images=['polar_box'],
87-
extensions=['png'], style='default', tol=0.03)
88+
tol={'aarch64': 0.04}.get(platform.machine(), 0.03),
89+
extensions=['png'], style='default')
8890
def test_polar_box():
8991
fig = plt.figure(figsize=(5, 5))
9092

0 commit comments

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