check_figures_equal decorator reuses figures if called multiple times inside a single test. #15079
Labels
Good first issue
Open a pull request against these issues if there are no active ones!
topic: testing
Milestone
Bug report
Bug summary
When running a test suite with multiple tests using check_figures_equal, figures are re-used, causing plot elements to become "stacked", causing tests to unexpectedly fail.
Code for reproduction
running as:
pytest .\mpl_figure_equal_test.py
Actual outcome



Reference Screenshots:
Expected outcome



Reference Screenshots:
Matplotlib version
Windows 10
matplotlib 3.1.0
print(matplotlib.get_backend())
):TkAgg
3.7.3
pytest 4.5.0
everything installed via pip
matplotlib/lib/matplotlib/testing/decorators.py
Lines 394 to 395 in e86c9cd
I'm guessing these lines are at fault, and might need some kind of other information to distinguish them?
The text was updated successfully, but these errors were encountered: