From 8b585994418d62cde4a525f4e6a14aeba42459f4 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 31 Mar 2018 00:33:37 -0400 Subject: [PATCH 4/4] Increase some tolerances for non-x86 arches. Signed-off-by: Elliott Sales de Andrade --- lib/matplotlib/tests/test_arrow_patches.py | 4 ++-- lib/matplotlib/tests/test_axes.py | 4 ++-- lib/matplotlib/tests/test_backends_interactive.py | 2 +- lib/matplotlib/tests/test_collections.py | 2 +- lib/matplotlib/tests/test_constrainedlayout.py | 3 ++- lib/matplotlib/tests/test_cycles.py | 6 +++--- lib/matplotlib/tests/test_figure.py | 2 +- lib/matplotlib/tests/test_image.py | 2 +- lib/matplotlib/tests/test_legend.py | 6 +++--- lib/matplotlib/tests/test_pickle.py | 2 +- lib/matplotlib/tests/test_streamplot.py | 2 +- lib/matplotlib/tests/test_units.py | 4 ++-- .../tests/test_axisartist_grid_helper_curvelinear.py | 4 ++-- 13 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/matplotlib/tests/test_arrow_patches.py b/lib/matplotlib/tests/test_arrow_patches.py index a9409e2c1..9627b3569 100644 --- a/lib/matplotlib/tests/test_arrow_patches.py +++ b/lib/matplotlib/tests/test_arrow_patches.py @@ -67,7 +67,7 @@ def __prepare_fancyarrow_dpi_cor_test(): @image_comparison(['fancyarrow_dpi_cor_100dpi.png'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0), + tol=0.016, savefig_kwarg=dict(dpi=100)) def test_fancyarrow_dpi_cor_100dpi(): """ @@ -82,7 +82,7 @@ def test_fancyarrow_dpi_cor_100dpi(): @image_comparison(['fancyarrow_dpi_cor_200dpi.png'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0), + tol=0.019, savefig_kwarg=dict(dpi=200)) def test_fancyarrow_dpi_cor_200dpi(): """ diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index de146a527..8574a95d2 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -407,7 +407,7 @@ def test_annotate_default_arrow(): assert ann.arrow_patch is not None -@image_comparison(['polar_axes'], style='default') +@image_comparison(['polar_axes'], style='default', tol=0.01) def test_polar_annotations(): # you can specify the xypoint and the xytext in different # positions and coordinate systems, and optionally turn on a @@ -3653,7 +3653,7 @@ def test_vertex_markers(): @image_comparison(['vline_hline_zorder', 'errorbar_zorder'], - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.02) def test_eb_line_zorder(): x = list(range(10)) diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index ad23abe3f..7b9660f2b 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -104,7 +104,7 @@ fig.canvas.mpl_connect("draw_event", lambda event: timer.start()) plt.show() """ -_test_timeout = 10 # Empirically, 1s is not enough on Travis. +_test_timeout = 30 # Empirically, 1s is not enough on Travis. @pytest.mark.parametrize("backend", _get_testable_interactive_backends()) diff --git a/lib/matplotlib/tests/test_collections.py b/lib/matplotlib/tests/test_collections.py index 0983283ec..1b079aff1 100644 --- a/lib/matplotlib/tests/test_collections.py +++ b/lib/matplotlib/tests/test_collections.py @@ -439,7 +439,7 @@ def test_barb_limits(): @image_comparison(['EllipseCollection_test_image.png'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.012) def test_EllipseCollection(): # Test basic functionality fig, ax = plt.subplots() diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py index 75311e70e..8de7b987d 100644 --- a/lib/matplotlib/tests/test_constrainedlayout.py +++ b/lib/matplotlib/tests/test_constrainedlayout.py @@ -164,7 +164,8 @@ def test_constrained_layout9(): fig.suptitle('Test Suptitle', fontsize=28) -@image_comparison(['constrained_layout10.png']) +@image_comparison(['constrained_layout10.png'], + tol=0.01) def test_constrained_layout10(): 'Test for handling legend outside axis' fig, axs = plt.subplots(2, 2, constrained_layout=True) diff --git a/lib/matplotlib/tests/test_cycles.py b/lib/matplotlib/tests/test_cycles.py index ee67b4e41..c52a5b0f8 100644 --- a/lib/matplotlib/tests/test_cycles.py +++ b/lib/matplotlib/tests/test_cycles.py @@ -9,7 +9,7 @@ from cycler import cycler @image_comparison(['color_cycle_basic.png'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.008) def test_colorcycle_basic(): fig, ax = plt.subplots() ax.set_prop_cycle(cycler('color', ['r', 'g', 'y'])) @@ -26,7 +26,7 @@ def test_colorcycle_basic(): @image_comparison(['marker_cycle.png', 'marker_cycle.png'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.008) def test_marker_cycle(): fig, ax = plt.subplots() ax.set_prop_cycle(cycler('c', ['r', 'g', 'y']) + @@ -59,7 +59,7 @@ def test_marker_cycle(): @image_comparison(['lineprop_cycle_basic.png'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.009) def test_linestylecycle_basic(): fig, ax = plt.subplots() ax.set_prop_cycle(cycler('ls', ['-', '--', ':'])) diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py index a9e8dfade..322acd41e 100644 --- a/lib/matplotlib/tests/test_figure.py +++ b/lib/matplotlib/tests/test_figure.py @@ -14,7 +14,7 @@ import pytest @image_comparison(['figure_align_labels'], - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.01) def test_align_labels(): # Check the figure.align_labels() command fig = plt.figure(tight_layout=True) diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py index 93cfbb260..122c884da 100644 --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -928,7 +928,7 @@ def test_imshow_endianess(): @image_comparison(['imshow_masked_interpolation'], - tol={'aarch64': 0.02}.get(platform.machine(), 0.0), + tol=0.006, remove_text=True, style='mpl20') def test_imshow_masked_interpolation(): diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py index 71499da44..23cfcb873 100644 --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py @@ -106,7 +106,7 @@ def test_multiple_keys(): @image_comparison(['rgba_alpha.png'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.007) def test_alpha_rgba(): import matplotlib.pyplot as plt @@ -117,7 +117,7 @@ def test_alpha_rgba(): @image_comparison(['rcparam_alpha.png'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.007) def test_alpha_rcparam(): import matplotlib.pyplot as plt @@ -145,7 +145,7 @@ def test_fancy(): @image_comparison(['framealpha'], remove_text=True, - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.018) def test_framealpha(): x = np.linspace(1, 100, 100) y = x diff --git a/lib/matplotlib/tests/test_pickle.py b/lib/matplotlib/tests/test_pickle.py index 0fad3cdf2..4d2599607 100644 --- a/lib/matplotlib/tests/test_pickle.py +++ b/lib/matplotlib/tests/test_pickle.py @@ -41,7 +41,7 @@ def test_simple(): @image_comparison(['multi_pickle.png'], remove_text=True, style='mpl20', - tol={'aarch64': 0.082}.get(platform.machine(), 0.0)) + tol=0.082) def test_complete(): fig = plt.figure('Figure with a label?', figsize=(10, 6)) diff --git a/lib/matplotlib/tests/test_streamplot.py b/lib/matplotlib/tests/test_streamplot.py index 1afc60543..dcac38102 100644 --- a/lib/matplotlib/tests/test_streamplot.py +++ b/lib/matplotlib/tests/test_streamplot.py @@ -49,7 +49,7 @@ def test_colormap(): @image_comparison(['streamplot_linewidth'], remove_text=True, style='mpl20', - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.002) def test_linewidth(): X, Y, U, V = velocity_field() speed = np.hypot(U, V) diff --git a/lib/matplotlib/tests/test_units.py b/lib/matplotlib/tests/test_units.py index f14425144..fd8f26502 100644 --- a/lib/matplotlib/tests/test_units.py +++ b/lib/matplotlib/tests/test_units.py @@ -74,7 +74,7 @@ def quantity_converter(): # Tests that the conversion machinery works properly for classes that # work as a facade over numpy arrays (like pint) @image_comparison(['plot_pint.png'], remove_text=False, style='mpl20', - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.003) def test_numpy_facade(quantity_converter): # use former defaults to match existing baseline image plt.rcParams['axes.formatter.limits'] = -7, 7 @@ -101,7 +101,7 @@ def test_numpy_facade(quantity_converter): # Tests gh-8908 @image_comparison(['plot_masked_units.png'], remove_text=True, style='mpl20', - tol={'aarch64': 0.02}.get(platform.machine(), 0.0)) + tol=0.007) def test_plot_masked_units(): data = np.linspace(-5, 5) data_masked = np.ma.array(data, mask=(data > -2) & (data < 2)) diff --git a/lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py b/lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py index 611908063..be11d7c6b 100644 --- a/lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py +++ b/lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py @@ -17,7 +17,7 @@ from mpl_toolkits.axisartist.grid_helper_curvelinear import \ @image_comparison(['custom_transform.png'], style='default', - tol={'aarch64': 0.034}.get(platform.machine(), 0.03)) + tol=0.04) def test_custom_transform(): class MyTransform(Transform): input_dims = 2 @@ -84,7 +84,7 @@ def test_custom_transform(): @image_comparison(['polar_box.png'], style='default', - tol={'aarch64': 0.04}.get(platform.machine(), 0.03)) + tol=0.04) def test_polar_box(): # Remove this line when this test image is regenerated. plt.rcParams['text.kerning_factor'] = 6 -- 2.21.1