Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4160365

Browse files
authored
Merge pull request #16735 from QuLogic/flaky-test_stem
TST: Make test_stem less flaky.
2 parents 4331c53 + 2e20058 commit 4160365

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/matplotlib/tests/test_axes.py

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

33443344

3345-
@pytest.mark.parametrize("use_line_collection", [True, False],
3346-
ids=['w/ line collection', 'w/o line collection'])
3347-
@image_comparison(['stem.png'], style='mpl20', remove_text=True)
3348-
def test_stem(use_line_collection):
3345+
@image_comparison(['stem.png', 'stem.png'], style='mpl20', remove_text=True)
3346+
def test_stem():
3347+
# Note, we don't use @pytest.mark.parametrize, because in parallel this
3348+
# might cause one process result to overwrite another's.
3349+
for use_line_collection in [True, False]:
3350+
_test_stem(use_line_collection)
3351+
3352+
3353+
def _test_stem(use_line_collection):
33493354
x = np.linspace(0.1, 2 * np.pi, 100)
33503355
args = (x, np.cos(x))
33513356
# Label is a single space to force a legend to be drawn, but to avoid any

0 commit comments

Comments
 (0)