diff --git a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py index 70fc22deb85e..32dac0861fed 100644 --- a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py +++ b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py @@ -59,7 +59,9 @@ def test_divider_append_axes(): assert bboxes["top"].x1 == bboxes["main"].x1 == bboxes["bottom"].x1 -@image_comparison(['twin_axes_empty_and_removed'], extensions=["png"], tol=1) +# Update style when regenerating the test image +@image_comparison(['twin_axes_empty_and_removed'], extensions=["png"], tol=1, + style=('classic', '_classic_test_patch')) def test_twin_axes_empty_and_removed(): # Purely cosmetic font changes (avoid overlap) mpl.rcParams.update( @@ -321,7 +323,9 @@ def test_fill_facecolor(): mark_inset(ax[3], axins, loc1=2, loc2=4, fc="g", ec="0.5", fill=False) -@image_comparison(['zoomed_axes.png', 'inverted_zoomed_axes.png']) +# Update style when regenerating the test image +@image_comparison(['zoomed_axes.png', 'inverted_zoomed_axes.png'], + style=('classic', '_classic_test_patch')) def test_zooming_with_inverted_axes(): fig, ax = plt.subplots() ax.plot([1, 2, 3], [1, 2, 3]) @@ -336,8 +340,10 @@ def test_zooming_with_inverted_axes(): inset_ax.axis([1.4, 1.1, 1.4, 1.1]) +# Update style when regenerating the test image @image_comparison(['anchored_direction_arrows.png'], - tol=0 if platform.machine() == 'x86_64' else 0.01) + tol=0 if platform.machine() == 'x86_64' else 0.01, + style=('classic', '_classic_test_patch')) def test_anchored_direction_arrows(): fig, ax = plt.subplots() ax.imshow(np.zeros((10, 10)), interpolation='nearest') @@ -346,7 +352,9 @@ def test_anchored_direction_arrows(): ax.add_artist(simple_arrow) -@image_comparison(['anchored_direction_arrows_many_args.png']) +# Update style when regenerating the test image +@image_comparison(['anchored_direction_arrows_many_args.png'], + style=('classic', '_classic_test_patch')) def test_anchored_direction_arrows_many_args(): fig, ax = plt.subplots() ax.imshow(np.ones((10, 10))) @@ -618,7 +626,9 @@ def test_auto_adjustable(): assert tbb.y1 == pytest.approx(fig.bbox.height - pad * fig.dpi) -@image_comparison(['rgb_axes.png'], remove_text=True) +# Update style when regenerating the test image +@image_comparison(['rgb_axes.png'], remove_text=True, + style=('classic', '_classic_test_patch')) def test_rgb_axes(): fig = plt.figure() ax = RGBAxes(fig, (0.1, 0.1, 0.8, 0.8), pad=0.1) @@ -629,7 +639,9 @@ def test_rgb_axes(): ax.imshow_rgb(r, g, b, interpolation='none') -@image_comparison(['insetposition.png'], remove_text=True) +# Update style when regenerating the test image +@image_comparison(['insetposition.png'], remove_text=True, + style=('classic', '_classic_test_patch')) def test_insetposition(): fig, ax = plt.subplots(figsize=(2, 2)) ax_ins = plt.axes([0, 0, 1, 1]) diff --git a/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py b/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py index ef330a027681..10e6f58b3ccd 100644 --- a/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py +++ b/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py @@ -1799,8 +1799,9 @@ def test_subfigure_simple(): ax = sf[1].add_subplot(1, 1, 1, projection='3d', label='other') +# Update style when regenerating the test image @image_comparison(baseline_images=['computed_zorder'], remove_text=True, - extensions=['png']) + extensions=['png'], style=('classic', '_classic_test_patch')) def test_computed_zorder(): fig = plt.figure() ax1 = fig.add_subplot(221, projection='3d') diff --git a/lib/mpl_toolkits/mplot3d/tests/test_legend3d.py b/lib/mpl_toolkits/mplot3d/tests/test_legend3d.py index d5ab2e6ab7d5..b13ab814a49d 100644 --- a/lib/mpl_toolkits/mplot3d/tests/test_legend3d.py +++ b/lib/mpl_toolkits/mplot3d/tests/test_legend3d.py @@ -7,7 +7,9 @@ from mpl_toolkits.mplot3d import art3d -@image_comparison(['legend_plot.png'], remove_text=True) +# Update style when regenerating the test image +@image_comparison(['legend_plot.png'], remove_text=True, + style=('classic', '_classic_test_patch')) def test_legend_plot(): fig, ax = plt.subplots(subplot_kw=dict(projection='3d')) x = np.arange(10) @@ -16,7 +18,9 @@ def test_legend_plot(): ax.legend() -@image_comparison(['legend_bar.png'], remove_text=True) +# Update style when regenerating the test image +@image_comparison(['legend_bar.png'], remove_text=True, + style=('classic', '_classic_test_patch')) def test_legend_bar(): fig, ax = plt.subplots(subplot_kw=dict(projection='3d')) x = np.arange(10) @@ -25,7 +29,9 @@ def test_legend_bar(): ax.legend([b1[0], b2[0]], ['up', 'down']) -@image_comparison(['fancy.png'], remove_text=True) +# Update style when regenerating the test image +@image_comparison(['fancy.png'], remove_text=True, + style=('classic', '_classic_test_patch')) def test_fancy(): fig, ax = plt.subplots(subplot_kw=dict(projection='3d')) ax.plot(np.arange(10), np.full(10, 5), np.full(10, 5), 'o--', label='line')