Skip to content

Commit 5cc8c28

Browse files
committed
Ensure bar_xticks length matches index in test_series.py
Add an assertion to verify the length of `bar_xticks` aligns with the length of the index. This improves the test's robustness by ensuring the data and ticks remain consistent.
1 parent 8ed678d commit 5cc8c28

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pandas/tests/plotting/test_series.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ def test_bar_line_plot(self):
990990
line_xticks = [
991991
label for label in ax.get_xticklabels() if label.get_text() in years
992992
]
993+
assert len(bar_xticks) == len(index)
993994
assert bar_xticks == line_xticks
994995
x_limits = ax.get_xlim()
995996
assert x_limits[0] <= bar_xticks[0].get_position()[0]

0 commit comments

Comments
 (0)