Skip to content

Commit

Permalink
TST: fix warning for pie chart (#37669)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanovmg authored Nov 8, 2020
1 parent 68e5b4c commit 4f56b2d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2650,11 +2650,20 @@ def test_pie_df(self):
self._check_colors(ax.patches, facecolors=color_args)

def test_pie_df_nan(self):
import matplotlib as mpl

df = DataFrame(np.random.rand(4, 4))
for i in range(4):
df.iloc[i, i] = np.nan
fig, axes = self.plt.subplots(ncols=4)
df.plot.pie(subplots=True, ax=axes, legend=True)

# GH 37668
kwargs = {}
if mpl.__version__ >= "3.3":
kwargs = {"normalize": True}

with tm.assert_produces_warning(None):
df.plot.pie(subplots=True, ax=axes, legend=True, **kwargs)

base_expected = ["0", "1", "2", "3"]
for i, ax in enumerate(axes):
Expand Down

0 comments on commit 4f56b2d

Please sign in to comment.