Skip to content

Commit 28ec4cc

Browse files
sinhrksjreback
authored andcommitted
TST: use types.api in plotting (#13867)
1 parent 59f2557 commit 28ec4cc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas/tests/plotting/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pandas import DataFrame
99
from pandas.compat import zip, iteritems, OrderedDict
1010
from pandas.util.decorators import cache_readonly
11-
import pandas.core.common as com
11+
from pandas.types.api import is_list_like
1212
import pandas.util.testing as tm
1313
from pandas.util.testing import (ensure_clean,
1414
assert_is_valid_plot_return_object)
@@ -157,7 +157,7 @@ def _check_visible(self, collections, visible=True):
157157
"""
158158
from matplotlib.collections import Collection
159159
if not isinstance(collections,
160-
Collection) and not com.is_list_like(collections):
160+
Collection) and not is_list_like(collections):
161161
collections = [collections]
162162

163163
for patch in collections:
@@ -242,7 +242,7 @@ def _check_text_labels(self, texts, expected):
242242
expected : str or list-like which has the same length as texts
243243
expected text label, or its list
244244
"""
245-
if not com.is_list_like(texts):
245+
if not is_list_like(texts):
246246
self.assertEqual(texts.get_text(), expected)
247247
else:
248248
labels = [t.get_text() for t in texts]

pandas/tests/plotting/test_frame.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,8 @@ def test_boxplot(self):
11521152

11531153
# different warning on py3
11541154
if not PY3:
1155-
axes = _check_plot_works(df.plot.box, subplots=True, logy=True)
1155+
with tm.assert_produces_warning(UserWarning):
1156+
axes = _check_plot_works(df.plot.box, subplots=True, logy=True)
11561157

11571158
self._check_axes_shape(axes, axes_num=3, layout=(1, 3))
11581159
self._check_ax_scales(axes, yaxis='log')

0 commit comments

Comments
 (0)