From 66b5d8d7c5cbcb03d8d9560b2f41aa240eca7643 Mon Sep 17 00:00:00 2001 From: Bingyao Liu Date: Fri, 19 Jul 2019 22:35:02 +0800 Subject: [PATCH] Stopgap fix for pandas converters in tests. --- lib/matplotlib/tests/test_axes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index ce3305a9ac62..85b220c2d1d7 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1598,9 +1598,6 @@ def test_boxplot_dates_pandas(pd): def test_bar_pandas(pd): # Smoke test for pandas - - fig, ax = plt.subplots() - df = pd.DataFrame( {'year': [2018, 2018, 2018], 'month': [1, 1, 1], @@ -1612,8 +1609,12 @@ def test_bar_pandas(pd): dates = monthly.index forecast = monthly['value'] baseline = monthly['value'] + + pd.plotting.register_matplotlib_converters() + fig, ax = plt.subplots() ax.bar(dates, forecast, width=10, align='center') ax.plot(dates, baseline, color='orange', lw=4) + pd.plotting.deregister_matplotlib_converters() @image_comparison(['hist_log'], remove_text=True)