From 36f7e221ba7bd61dafdae89b49495d79551fe1e2 Mon Sep 17 00:00:00 2001 From: Kaiqi Dong Date: Sun, 2 Feb 2020 17:42:19 +0100 Subject: [PATCH] CI: Remove warning raising after new matplotlib release (#31573) --- pandas/tests/plotting/test_converter.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index 9cd3ccbf9214e..e54f4784e9c4f 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -8,6 +8,7 @@ import pandas._config.config as cf from pandas.compat.numpy import np_datetime64_compat +import pandas.util._test_decorators as td from pandas import Index, Period, Series, Timestamp, date_range import pandas._testing as tm @@ -59,6 +60,7 @@ def test_register_by_default(self): call = [sys.executable, "-c", code] assert subprocess.check_call(call) == 0 + @td.skip_if_no("matplotlib", min_version="3.1.3") def test_registering_no_warning(self): plt = pytest.importorskip("matplotlib.pyplot") s = Series(range(12), index=date_range("2017", periods=12)) @@ -66,9 +68,7 @@ def test_registering_no_warning(self): # Set to the "warn" state, in case this isn't the first test run register_matplotlib_converters() - with tm.assert_produces_warning(DeprecationWarning, check_stacklevel=False): - # GH#30588 DeprecationWarning from 2D indexing - ax.plot(s.index, s.values) + ax.plot(s.index, s.values) def test_pandas_plots_register(self): pytest.importorskip("matplotlib.pyplot") @@ -91,6 +91,7 @@ def test_matplotlib_formatters(self): assert Timestamp not in units.registry assert Timestamp in units.registry + @td.skip_if_no("matplotlib", min_version="3.1.3") def test_option_no_warning(self): pytest.importorskip("matplotlib.pyplot") ctx = cf.option_context("plotting.matplotlib.register_converters", False) @@ -100,15 +101,12 @@ def test_option_no_warning(self): # Test without registering first, no warning with ctx: - # GH#30588 DeprecationWarning from 2D indexing on Index - with tm.assert_produces_warning(DeprecationWarning, check_stacklevel=False): - ax.plot(s.index, s.values) + ax.plot(s.index, s.values) # Now test with registering register_matplotlib_converters() with ctx: - with tm.assert_produces_warning(DeprecationWarning, check_stacklevel=False): - ax.plot(s.index, s.values) + ax.plot(s.index, s.values) def test_registry_resets(self): units = pytest.importorskip("matplotlib.units")