Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7dfc22

Browse files
committed
Increase default tolerance slightly for 32-bit systems.
Around 900 tests fail on 32-bit systems, but with rather small RMS.
1 parent f8d10f5 commit e7dfc22

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ def image_comparison(baseline_images, extensions=None, tol=0,
336336
tol : float, default: 0
337337
The RMS threshold above which the test is considered failed.
338338
339+
Due to expected small differences in floating-point calculations, on
340+
32-bit systems an additional 0.06 is added to this threshold.
341+
339342
freetype_version : str or tuple
340343
The expected freetype version or range of versions for this test to
341344
pass.
@@ -378,6 +381,8 @@ def image_comparison(baseline_images, extensions=None, tol=0,
378381
extensions = ['png', 'pdf', 'svg']
379382
if savefig_kwarg is None:
380383
savefig_kwarg = dict() # default no kwargs to savefig
384+
if sys.maxsize <= 2**32:
385+
tol += 0.06
381386
return _pytest_image_comparison(
382387
baseline_images=baseline_images, extensions=extensions, tol=tol,
383388
freetype_version=freetype_version, remove_text=remove_text,

0 commit comments

Comments
 (0)