Skip to content

Commit ab4f7a6

Browse files
committed
Updated Test cases
1 parent cfa3ada commit ab4f7a6

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

pandas/tests/plotting/test_misc.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,17 @@ def test_bar_plt_xaxis_intervalrange(self):
683683
)
684684

685685

686+
def test_plot_bar_label_count_default():
687+
df = DataFrame(
688+
[(30, 10, 10, 10), (20, 20, 20, 20), (10, 30, 30, 10)], columns=list("ABCD")
689+
)
690+
df.plot(subplots=True, kind="bar", title=["A", "B", "C", "D"])
691+
692+
686693
def test_plot_bar_label_count_expected_fail():
687-
df = DataFrame([(30, 10, 10), (20, 20, 20), (10, 30, 30)], columns=list("ABC"))
694+
df = DataFrame(
695+
[(30, 10, 10, 10), (20, 20, 20, 20), (10, 30, 30, 10)], columns=list("ABCD")
696+
)
688697
with pytest.raises(
689698
ValueError,
690699
match="The length of `title` must equal the number of columns "
@@ -693,11 +702,12 @@ def test_plot_bar_label_count_expected_fail():
693702
df.plot(
694703
subplots=[("A", "B")],
695704
kind="bar",
696-
stacked=True,
697-
title=["A&B", "C", "Extra Title"],
705+
title=["A&B", "C", "D", "Extra Title"],
698706
)
699707

700708

701709
def test_plot_bar_label_count_expected_success():
702-
df = DataFrame([(30, 10, 10), (20, 20, 20), (10, 30, 30)], columns=list("ABC"))
703-
df.plot(subplots=[("A", "B")], kind="bar", stacked=True, title=["A&B", "C"])
710+
df = DataFrame(
711+
[(30, 10, 10, 10), (20, 20, 20, 20), (10, 30, 30, 10)], columns=list("ABCD")
712+
)
713+
df.plot(subplots=[("A", "B", "D")], kind="bar", title=["A&B&D", "C"])

0 commit comments

Comments
 (0)