Increase a few test tolerances on alternate arches.

This commit is contained in:
Elliott Sales de Andrade 2021-08-24 04:50:18 -04:00
parent 569a4ddc11
commit ef61af71e2
6 changed files with 97 additions and 4 deletions

View File

@ -1,7 +1,7 @@
From 40ffe133485dba72cdfcb50ec4a11ef69e92c7ea Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 27 Sep 2017 19:35:59 -0400
Subject: [PATCH 1/4] matplotlibrc path search fix
Subject: [PATCH 1/5] matplotlibrc path search fix
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---

View File

@ -1,7 +1,7 @@
From 91ec30ea100a1632b6843b201554f28363aa1677 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 14 Feb 2020 06:05:42 -0500
Subject: [PATCH 2/4] Set FreeType version to 2.11.0 and update tolerances.
Subject: [PATCH 2/5] Set FreeType version to 2.11.0 and update tolerances.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---

View File

@ -1,7 +1,7 @@
From 24874d70222f64e221d8769d02fe91fe01554b1e Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 4 Jun 2021 02:32:31 -0400
Subject: [PATCH 3/4] Slightly increase tolerance on rcupdate test.
Subject: [PATCH 3/5] Slightly increase tolerance on rcupdate test.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---

View File

@ -1,7 +1,7 @@
From 58debfaafeabc791b49dd9e3f2461b9cfe9812ab Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Tue, 24 Aug 2021 03:28:52 -0400
Subject: [PATCH 4/4] Ensure full environment is passed to headless test.
Subject: [PATCH 4/5] Ensure full environment is passed to headless test.
Otherwise, e.g., `PYTHONPATH` is not available.

View File

@ -0,0 +1,91 @@
From 6279bb6519e33fa875a30fab4fcf86d4f05adafd Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Tue, 24 Aug 2021 04:47:50 -0400
Subject: [PATCH 5/5] Increase a few test tolerances on some arches.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/matplotlib/tests/test_axes.py | 6 ++++--
lib/matplotlib/tests/test_contour.py | 3 ++-
lib/matplotlib/tests/test_image.py | 4 ++--
lib/matplotlib/tests/test_lines.py | 4 +++-
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
index 5b6607a696..8233a436d5 100644
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -867,7 +867,8 @@ def test_imshow():
ax.imshow("r", data=data)
-@image_comparison(['imshow_clip'], style='mpl20')
+@image_comparison(['imshow_clip'], style='mpl20',
+ tol=0 if platform.machine() == 'x86_64' else 1.24)
def test_imshow_clip():
# As originally reported by Gellule Xg <gellule.xg@free.fr>
# use former defaults to match existing baseline image
@@ -2059,7 +2060,8 @@ def test_contour_hatching():
extend='both', alpha=0.5)
-@image_comparison(['contour_colorbar'], style='mpl20')
+@image_comparison(['contour_colorbar'], style='mpl20',
+ tol=0 if platform.machine() == 'x86_64' else 0.02)
def test_contour_colorbar():
x, y, z = contour_dat()
diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py
index 6396105f12..ea13615e4b 100644
--- a/lib/matplotlib/tests/test_contour.py
+++ b/lib/matplotlib/tests/test_contour.py
@@ -341,7 +341,8 @@ def test_contourf_log_extension():
@image_comparison(['contour_addlines.png'],
- remove_text=True, style='mpl20', tol=0.03)
+ remove_text=True, style='mpl20',
+ tol=0.03 if platform.machine() == 'x86_64' else 0.15)
# tolerance is because image changed minutely when tick finding on
# colorbars was cleaned up...
def test_contour_addlines():
diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py
index 37dddd4e47..01a06378d8 100644
--- a/lib/matplotlib/tests/test_image.py
+++ b/lib/matplotlib/tests/test_image.py
@@ -1330,8 +1330,8 @@ def test_nonuniform_and_pcolor():
ax.set(xlim=(0, 10))
-@image_comparison(["rgba_antialias.png"], style="mpl20",
- remove_text=True)
+@image_comparison(["rgba_antialias.png"], style="mpl20", remove_text=True,
+ tol=0 if platform.machine() == 'x86_64' else 0.007)
def test_rgba_antialias():
fig, axs = plt.subplots(2, 2, figsize=(3.5, 3.5), sharex=False,
sharey=False, constrained_layout=True)
diff --git a/lib/matplotlib/tests/test_lines.py b/lib/matplotlib/tests/test_lines.py
index 21cb221405..f19542201c 100644
--- a/lib/matplotlib/tests/test_lines.py
+++ b/lib/matplotlib/tests/test_lines.py
@@ -3,6 +3,7 @@ Tests specific to the lines module.
"""
import itertools
+import platform
import timeit
from types import SimpleNamespace
@@ -150,7 +151,8 @@ def test_set_drawstyle():
assert len(line.get_path().vertices) == len(x)
-@image_comparison(['line_collection_dashes'], remove_text=True, style='mpl20')
+@image_comparison(['line_collection_dashes'], remove_text=True, style='mpl20',
+ tol=0 if platform.machine() == 'x86_64' else 0.62)
def test_set_line_coll_dash_image():
fig, ax = plt.subplots()
np.random.seed(0)
--
2.31.1

View File

@ -59,6 +59,7 @@ Patch1002: 0002-Set-FreeType-version-to-%{ftver}-and-update-tolerances.patc
Patch1003: 0003-Slightly-increase-tolerance-on-rcupdate-test.patch
# https://github.com/matplotlib/matplotlib/pull/20884
Patch1004: 0004-Ensure-full-environment-is-passed-to-headless-test.patch
Patch1005: 0005-Increase-a-few-test-tolerances-on-some-arches.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -283,6 +284,7 @@ cp -p %{SOURCE1} mplsetup.cfg
%patch1003 -p1
%patch1004 -p1
%patch1005 -p1
%generate_buildrequires