From 891acbac21629868d0815efdd01d245f80edd1fb Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Wed, 5 Jun 2019 14:32:23 -0500 Subject: [PATCH 1/2] TST: avoid matplotlib warnings in tests --- pandas/tests/plotting/test_frame.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandas/tests/plotting/test_frame.py b/pandas/tests/plotting/test_frame.py index f42f86540e46b..1f9c3c059dd9c 100644 --- a/pandas/tests/plotting/test_frame.py +++ b/pandas/tests/plotting/test_frame.py @@ -166,7 +166,7 @@ def test_integer_array_plot(self): def test_mpl2_color_cycle_str(self): # GH 15516 - colors = ['C' + str(x) for x in range(10)] + colors = ['c' + str(x) for x in range(10)] df = DataFrame(randn(10, 3), columns=['a', 'b', 'c']) for c in colors: _check_plot_works(df.plot, color=c) @@ -800,7 +800,10 @@ def test_line_area_stacked(self): with pytest.raises(ValueError): mixed_df.plot(stacked=True) - _check_plot_works(df.plot, kind=kind, logx=True, stacked=True) + # Use an index with strictly positive values, preventing + # matplotlib from warning about ignoring xlim + df2 = df.set_index(df.index + 1) + _check_plot_works(df2.plot, kind=kind, logx=True, stacked=True) def test_line_area_nan_df(self): values1 = [1, 2, np.nan, 3] From 1233ae0f3d98050f70f8c8bbddeba92532456905 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Thu, 6 Jun 2019 11:25:12 -0500 Subject: [PATCH 2/2] revert disputed test change --- pandas/tests/plotting/test_frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/plotting/test_frame.py b/pandas/tests/plotting/test_frame.py index 1f9c3c059dd9c..9a2b87558b869 100644 --- a/pandas/tests/plotting/test_frame.py +++ b/pandas/tests/plotting/test_frame.py @@ -166,7 +166,7 @@ def test_integer_array_plot(self): def test_mpl2_color_cycle_str(self): # GH 15516 - colors = ['c' + str(x) for x in range(10)] + colors = ['C' + str(x) for x in range(10)] df = DataFrame(randn(10, 3), columns=['a', 'b', 'c']) for c in colors: _check_plot_works(df.plot, color=c)