python-matplotlib/0006-Increase-mathfont-test-tolerance-on-some-systems.patch
Elliott Sales de Andrade 97a48b2aed Really fix the ppc64le/s390x tolerance patch.
Third time's the charm?
2021-08-09 23:57:50 -04:00

45 lines
1.9 KiB
Diff

From 28753e5db82bba5898ee302d687d201ae2a96cd6 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 9 Aug 2021 21:38:15 -0400
Subject: [PATCH 6/6] Increase mathfont test tolerance on some systems.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/matplotlib/tests/test_mathtext.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py
index b5fd906d2f..8e3801a231 100644
--- a/lib/matplotlib/tests/test_mathtext.py
+++ b/lib/matplotlib/tests/test_mathtext.py
@@ -1,5 +1,6 @@
import io
import os
+import platform
import re
import numpy as np
@@ -189,7 +190,8 @@ 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)
+@image_comparison(baseline_images=None,
+ tol=0.011 if platform.machine() in ('ppc64le', 's390x') else 0)
def test_mathtext_rendering(baseline_images, fontset, index, text):
mpl.rcParams['mathtext.fontset'] = fontset
fig = plt.figure(figsize=(5.25, 0.75))
@@ -213,7 +215,8 @@ def test_mathtext_rendering_lightweight(baseline_images, fontset, index, text):
@pytest.mark.parametrize(
'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif'])
@pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True)
-@image_comparison(baseline_images=None, extensions=['png'])
+@image_comparison(baseline_images=None, extensions=['png'],
+ tol=0.011 if platform.machine() in ('ppc64le', 's390x') else 0)
def test_mathfont_rendering(baseline_images, fontset, index, text):
mpl.rcParams['mathtext.fontset'] = fontset
fig = plt.figure(figsize=(5.25, 0.75))
--
2.31.1