Skip to content

Commit 5a74e97

Browse files
onshekStefRe
andauthored
BUG: clean the figure windows created by tests (#37762)
* BUG: clearn the figure windows created by tests fixed: FAILED pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_ts_plot_with_tz['UTC'] * Revert "BUG: clearn the figure windows created by tests" This reverts commit 6783ce7. * BUG: clearn the figure windows created by tests fixed: FAILED pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_ts_plot_with_tz['UTC'] Co-Authored-By: Steffen Rehberg <[email protected]> Co-authored-by: Steffen Rehberg <[email protected]>
1 parent 2eb3530 commit 5a74e97

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/tests/plotting/test_converter.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,17 @@ def test_registering_no_warning(self):
7070
# Set to the "warn" state, in case this isn't the first test run
7171
register_matplotlib_converters()
7272
ax.plot(s.index, s.values)
73+
plt.close()
7374

7475
def test_pandas_plots_register(self):
75-
pytest.importorskip("matplotlib.pyplot")
76+
plt = pytest.importorskip("matplotlib.pyplot")
7677
s = Series(range(12), index=date_range("2017", periods=12))
7778
# Set to the "warn" state, in case this isn't the first test run
7879
with tm.assert_produces_warning(None) as w:
7980
s.plot()
8081

8182
assert len(w) == 0
83+
plt.close()
8284

8385
def test_matplotlib_formatters(self):
8486
units = pytest.importorskip("matplotlib.units")
@@ -108,6 +110,7 @@ def test_option_no_warning(self):
108110
register_matplotlib_converters()
109111
with ctx:
110112
ax.plot(s.index, s.values)
113+
plt.close()
111114

112115
def test_registry_resets(self):
113116
units = pytest.importorskip("matplotlib.units")

0 commit comments

Comments
 (0)