File: 0008-Increase-test-tollerance.patch

package info (click to toggle)
matplotlib 3.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 78,264 kB
  • sloc: python: 123,969; cpp: 57,655; ansic: 29,431; objc: 2,244; javascript: 757; makefile: 163; sh: 111
file content (62 lines) | stat: -rw-r--r-- 2,787 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From: Sandro Tosi <morph@debian.org>
Date: Wed, 18 Jan 2017 20:05:24 -0500
Subject: Increase test tollerance

Patch taken from Fedora packaging:
http://pkgs.fedoraproject.org/cgit/rpms/python-matplotlib.git/plain/python-matplotlib-increase-tests-tolerance.patch
---
 lib/matplotlib/testing/decorators.py     | 2 +-
 lib/matplotlib/tests/test_mathtext.py    | 5 ++---
 lib/matplotlib/tests/test_patheffects.py | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

--- a/lib/matplotlib/testing/decorators.py
+++ b/lib/matplotlib/testing/decorators.py
@@ -299,7 +299,7 @@ def _pytest_image_comparison(baseline_im
     return decorator
 
 
-def image_comparison(baseline_images, extensions=None, tol=0,
+def image_comparison(baseline_images, extensions=None, tol=0.306,
                      freetype_version=None, remove_text=False,
                      savefig_kwarg=None,
                      # Default of mpl_test_settings fixture and cleanup too.
--- a/lib/matplotlib/tests/test_mathtext.py
+++ b/lib/matplotlib/tests/test_mathtext.py
@@ -166,7 +166,6 @@ for fonts, chars in font_test_specs:
 
 font_tests = list(filter(lambda x: x[1] is not None, enumerate(font_tests)))
 
-
 @pytest.fixture
 def baseline_images(request, fontset, index):
     return ['%s_%s_%02d' % (request.param, fontset, index)]
@@ -178,7 +177,7 @@ def baseline_images(request, fontset, in
                          ['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.310)
 def test_mathtext_rendering(baseline_images, fontset, index, test):
     mpl.rcParams['mathtext.fontset'] = fontset
     fig = plt.figure(figsize=(5.25, 0.75))
@@ -192,7 +191,7 @@ def test_mathtext_rendering(baseline_ima
                          ['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.310)
 def test_mathfont_rendering(baseline_images, fontset, index, test):
     mpl.rcParams['mathtext.fontset'] = fontset
     fig = plt.figure(figsize=(5.25, 0.75))
--- a/lib/matplotlib/tests/test_patheffects.py
+++ b/lib/matplotlib/tests/test_patheffects.py
@@ -115,7 +115,7 @@ def test_SimplePatchShadow_offset():
     assert pe._offset == (4, 5)
 
 
-@image_comparison(['collection'], tol=0.03, style='mpl20')
+@image_comparison(['collection'], tol=0.083, style='mpl20')
 def test_collection():
     x, y = np.meshgrid(np.linspace(0, 10, 150), np.linspace(-5, 5, 100))
     data = np.sin(x) + np.cos(y)