From 8450250f750063cccdbfefcce41f7223e3f89820 Mon Sep 17 00:00:00 2001 From: sinhrks Date: Sun, 31 Jul 2016 07:03:51 +0900 Subject: [PATCH] TST: use types.api in plotting --- pandas/tests/plotting/common.py | 6 +++--- pandas/tests/plotting/test_frame.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pandas/tests/plotting/common.py b/pandas/tests/plotting/common.py index d80eb891c5bd6..faf16430fc94f 100644 --- a/pandas/tests/plotting/common.py +++ b/pandas/tests/plotting/common.py @@ -8,7 +8,7 @@ from pandas import DataFrame from pandas.compat import zip, iteritems, OrderedDict from pandas.util.decorators import cache_readonly -import pandas.core.common as com +from pandas.types.api import is_list_like import pandas.util.testing as tm from pandas.util.testing import (ensure_clean, assert_is_valid_plot_return_object) @@ -157,7 +157,7 @@ def _check_visible(self, collections, visible=True): """ from matplotlib.collections import Collection if not isinstance(collections, - Collection) and not com.is_list_like(collections): + Collection) and not is_list_like(collections): collections = [collections] for patch in collections: @@ -242,7 +242,7 @@ def _check_text_labels(self, texts, expected): expected : str or list-like which has the same length as texts expected text label, or its list """ - if not com.is_list_like(texts): + if not is_list_like(texts): self.assertEqual(texts.get_text(), expected) else: labels = [t.get_text() for t in texts] diff --git a/pandas/tests/plotting/test_frame.py b/pandas/tests/plotting/test_frame.py index 311da4a92e45a..11180c3e9b4f7 100644 --- a/pandas/tests/plotting/test_frame.py +++ b/pandas/tests/plotting/test_frame.py @@ -1152,7 +1152,8 @@ def test_boxplot(self): # different warning on py3 if not PY3: - axes = _check_plot_works(df.plot.box, subplots=True, logy=True) + with tm.assert_produces_warning(UserWarning): + axes = _check_plot_works(df.plot.box, subplots=True, logy=True) self._check_axes_shape(axes, axes_num=3, layout=(1, 3)) self._check_ax_scales(axes, yaxis='log')