python-matplotlib/0006-Increase-mathfont-test-tolerance-on-some-systems.patch
2021-08-09 23:26:31 -04:00

35 lines
1.3 KiB
Diff

From cc0a99e00aff1c05788396640938301cbdbcd32c 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 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py
index b5fd906d2f..c475ef2cf4 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
@@ -213,7 +214,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