diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index c524b21f1be9e..7a367ccab6d52 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -7,6 +7,7 @@ import pandas._config.config as cf +from pandas.compat import is_platform_windows from pandas.compat.numpy import np_datetime64_compat import pandas.util._test_decorators as td @@ -72,6 +73,11 @@ def test_registering_no_warning(self): ax.plot(s.index, s.values) plt.close() + @pytest.mark.xfail( + is_platform_windows(), + reason="Getting two warnings intermittently, see GH#37746", + strict=False, + ) def test_pandas_plots_register(self): plt = pytest.importorskip("matplotlib.pyplot") s = Series(range(12), index=date_range("2017", periods=12)) @@ -79,8 +85,10 @@ def test_pandas_plots_register(self): with tm.assert_produces_warning(None) as w: s.plot() - assert len(w) == 0 - plt.close() + try: + assert len(w) == 0 + finally: + plt.close() def test_matplotlib_formatters(self): units = pytest.importorskip("matplotlib.units")