From 96d941cb83af7c4bedfb1881869f60e8e2ae6ce0 Mon Sep 17 00:00:00 2001 From: theOehrly Date: Fri, 25 Dec 2020 21:27:49 +0100 Subject: [PATCH 1/2] TST: Remove broken test for deprecated functionality Registering converters by default is deprecated since GH28722. The test did not fail as the subprocess call contains errors in the python code. --- pandas/tests/plotting/test_converter.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index ae14318cdaa49..04abf707a71a2 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -54,17 +54,6 @@ def test_timtetonum_accepts_unicode(): class TestRegistration: - def test_register_by_default(self): - # Run in subprocess to ensure a clean state - code = ( - "'import matplotlib.units; " - "import pandas as pd; " - "units = dict(matplotlib.units.registry); " - "assert pd.Timestamp in units)'" - ) - 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") From e167e1a96ba5129b2ea8dc1e98e15e27fbe1f6f9 Mon Sep 17 00:00:00 2001 From: theOehrly Date: Mon, 28 Dec 2020 11:53:58 +0100 Subject: [PATCH 2/2] TST: Fix and modify test instead of removing it --- pandas/tests/plotting/test_converter.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index 04abf707a71a2..38e67a0e55a79 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -54,6 +54,17 @@ def test_timtetonum_accepts_unicode(): class TestRegistration: + def test_dont_register_by_default(self): + # Run in subprocess to ensure a clean state + code = ( + "import matplotlib.units; " + "import pandas as pd; " + "units = dict(matplotlib.units.registry); " + "assert pd.Timestamp not in units" + ) + 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")