From c3ed5e5f382567dacf30b6b463083e6991868725 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 29 Aug 2018 02:01:58 -0400 Subject: [PATCH] TST: Fix duplicate file usage when running in parallel. If the same filename is used for two tests in the same file, there's a possibility that one might overwrite the other when testing in parallel. --- lib/matplotlib/tests/test_axes.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index a5b7331d3777..6c1f7a2c4019 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -2996,24 +2996,21 @@ def test_hist_stacked_step(): ax.hist((d1, d2), histtype="step", stacked=True) -@image_comparison(baseline_images=['hist_stacked_normed']) -def test_hist_stacked_normed(): - # make some data - d1 = np.linspace(1, 3, 20) - d2 = np.linspace(0, 10, 50) - fig, ax = plt.subplots() - with pytest.warns(UserWarning): - ax.hist((d1, d2), stacked=True, normed=True) - - -@image_comparison(baseline_images=['hist_stacked_normed'], extensions=['png']) +@image_comparison(baseline_images=['hist_stacked_normed', + 'hist_stacked_normed']) def test_hist_stacked_density(): # make some data d1 = np.linspace(1, 3, 20) d2 = np.linspace(0, 10, 50) + fig, ax = plt.subplots() ax.hist((d1, d2), stacked=True, density=True) + # Also check that the old keyword works. + fig, ax = plt.subplots() + with pytest.warns(UserWarning): + ax.hist((d1, d2), stacked=True, normed=True) + @pytest.mark.parametrize('normed', [False, True]) @pytest.mark.parametrize('density', [False, True])