Skip to content

Commit e00b630

Browse files
committed
Revert test changes to reduce flakiness (before lock).
These should no longer be needed with the lock, and are hopefully a bit clearer again. This reverts commit 95aa968, "Make test_imagegrid_cbar_mode_edge less flaky." This reverts commit 2e20058, "Make test_stem less flaky."
1 parent edd23a4 commit e00b630

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,15 +3150,10 @@ def test_hist_stacked_weighted():
31503150
ax.hist((d1, d2), weights=(w1, w2), histtype="stepfilled", stacked=True)
31513151

31523152

3153-
@image_comparison(['stem.png', 'stem.png'], style='mpl20', remove_text=True)
3154-
def test_stem():
3155-
# Note, we don't use @pytest.mark.parametrize, because in parallel this
3156-
# might cause one process result to overwrite another's.
3157-
for use_line_collection in [True, False]:
3158-
_test_stem(use_line_collection)
3159-
3160-
3161-
def _test_stem(use_line_collection):
3153+
@pytest.mark.parametrize("use_line_collection", [True, False],
3154+
ids=['w/ line collection', 'w/o line collection'])
3155+
@image_comparison(['stem.png'], style='mpl20', remove_text=True)
3156+
def test_stem(use_line_collection):
31623157
x = np.linspace(0.1, 2 * np.pi, 100)
31633158
args = (x, np.cos(x))
31643159
# Label is a single space to force a legend to be drawn, but to avoid any

lib/mpl_toolkits/tests/test_axes_grid.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,10 @@
1212
# The original version of this test relied on mpl_toolkits's slightly different
1313
# colorbar implementation; moving to matplotlib's own colorbar implementation
1414
# caused the small image comparison error.
15-
@image_comparison(['imagegrid_cbar_mode.png', 'imagegrid_cbar_mode.png'],
15+
@pytest.mark.parametrize("legacy_colorbar", [False, True])
16+
@image_comparison(['imagegrid_cbar_mode.png'],
1617
remove_text=True, style='mpl20', tol=0.3)
17-
def test_imagegrid_cbar_mode_edge():
18-
# Note, we don't use @pytest.mark.parametrize, because in parallel this
19-
# might cause one process result to overwrite another's.
20-
for legacy_colorbar in [False, True]:
21-
_test_imagegrid_cbar_mode_edge(legacy_colorbar)
22-
23-
24-
def _test_imagegrid_cbar_mode_edge(legacy_colorbar):
18+
def test_imagegrid_cbar_mode_edge(legacy_colorbar):
2519
mpl.rcParams["mpl_toolkits.legacy_colorbar"] = legacy_colorbar
2620

2721
X, Y = np.meshgrid(np.linspace(0, 6, 30), np.linspace(0, 6, 30))

0 commit comments

Comments
 (0)