Blob Blame History Raw
From cd8908e8bab3827e6f8bb8e5d9b25bbd9db0aa18 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 26 Feb 2018 02:42:50 -0500
Subject: [PATCH 1/3] Increase tolerance for new FreeType.

Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
 lib/cartopy/tests/mpl/test_examples.py  |  5 +----
 lib/cartopy/tests/mpl/test_gridliner.py |  9 +++++++--
 lib/cartopy/tests/mpl/test_ticks.py     | 12 ++++++------
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/lib/cartopy/tests/mpl/test_examples.py b/lib/cartopy/tests/mpl/test_examples.py
index 09dd8ee4..0a7591cf 100644
--- a/lib/cartopy/tests/mpl/test_examples.py
+++ b/lib/cartopy/tests/mpl/test_examples.py
@@ -49,10 +49,7 @@ def test_global_map():
 
 
 @pytest.mark.natural_earth
-@ExampleImageTesting(['contour_label'],
-                     tolerance=(9.9
-                                if MPL_VERSION < parse_version("3.2")
-                                else 0.5))
+@ExampleImageTesting(['contour_label'], tolerance=10.4)
 def test_contour_label():
     from cartopy.tests.mpl.test_caching import sample_data
     fig = plt.figure()
diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py
index c9699eeb..122fefc2 100644
--- a/lib/cartopy/tests/mpl/test_gridliner.py
+++ b/lib/cartopy/tests/mpl/test_gridliner.py
@@ -133,6 +133,11 @@ grid_label_image = 'gridliner_labels'
 grid_label_inline_image = 'gridliner_labels_inline'
 grid_label_inline_usa_image = 'gridliner_labels_inline_usa'
 
+# Force higher tolerance due to new FreeType on Fedora.
+grid_label_tol = 15.2
+grid_label_inline_tol = 11.0
+grid_label_inline_usa_tol = 10.7
+
 
 @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug")
 @pytest.mark.natural_earth
@@ -210,7 +215,7 @@ def test_grid_labels():
 
 @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug")
 @pytest.mark.natural_earth
-@ImageTesting(['gridliner_labels_tight'], tolerance=4)
+@ImageTesting(['gridliner_labels_tight'], tolerance=47.1)
 def test_grid_labels_tight():
     # Ensure tight layout accounts for gridlines
     fig = plt.figure(figsize=(7, 5))
@@ -295,7 +300,7 @@ def test_grid_labels_inline_usa():
 
 
 @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug")
-@ImageTesting(["gridliner_labels_bbox_style"], tolerance=grid_label_tol)
+@ImageTesting(["gridliner_labels_bbox_style"], tolerance=41.5)
 def test_gridliner_labels_bbox_style():
     top = 49.3457868  # north lat
     left = -124.7844079  # west long
diff --git a/lib/cartopy/tests/mpl/test_ticks.py b/lib/cartopy/tests/mpl/test_ticks.py
index 2eb6c470..46570324 100644
--- a/lib/cartopy/tests/mpl/test_ticks.py
+++ b/lib/cartopy/tests/mpl/test_ticks.py
@@ -12,8 +12,8 @@ from cartopy.tests.mpl import ImageTesting
 
 
 @pytest.mark.natural_earth
-@ImageTesting(['xticks_no_transform'])
-def test_set_xticks_no_transform():
+@ImageTesting(['xticks_no_transform'], tolerance=6.71)
+def test_set_xticks_no_transfora():
     ax = plt.axes(projection=ccrs.PlateCarree())
     ax.coastlines('110m')
     ax.xaxis.set_major_formatter(LongitudeFormatter(degree_symbol=''))
@@ -22,7 +22,7 @@ def test_set_xticks_no_transform():
 
 
 @pytest.mark.natural_earth
-@ImageTesting(['xticks_cylindrical'])
+@ImageTesting(['xticks_cylindrical'], tolerance=7.13)
 def test_set_xticks_cylindrical():
     ax = plt.axes(projection=ccrs.Mercator(min_latitude=-85, max_latitude=85))
     ax.coastlines('110m')
@@ -41,7 +41,7 @@ def test_set_xticks_non_cylindrical():
 
 
 @pytest.mark.natural_earth
-@ImageTesting(['yticks_no_transform'])
+@ImageTesting(['yticks_no_transform'], tolerance=3.75)
 def test_set_yticks_no_transform():
     ax = plt.axes(projection=ccrs.PlateCarree())
     ax.coastlines('110m')
@@ -51,7 +51,7 @@ def test_set_yticks_no_transform():
 
 
 @pytest.mark.natural_earth
-@ImageTesting(['yticks_cylindrical'])
+@ImageTesting(['yticks_cylindrical'], tolerance=4.37)
 def test_set_yticks_cylindrical():
     ax = plt.axes(projection=ccrs.Mercator(min_latitude=-85, max_latitude=85))
     ax.coastlines('110m')
@@ -72,7 +72,7 @@ def test_set_yticks_non_cylindrical():
 
 
 @pytest.mark.natural_earth
-@ImageTesting(['xyticks'])
+@ImageTesting(['xyticks'], tolerance=7.19)
 def test_set_xyticks():
     fig = plt.figure(figsize=(10, 10))
     projections = (ccrs.PlateCarree(),
-- 
2.35.1