Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions pandas/tests/plotting/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,13 @@ def test_parallel_coordinates_with_sorted_labels(self):
ax = plotting.parallel_coordinates(df, "class", sort_labels=True)
polylines, labels = ax.get_legend_handles_labels()
color_label_tuples = zip(
[polyline.get_color() for polyline in polylines], labels
[polyline.get_color() for polyline in polylines], labels, strict=True
)
ordered_color_label_tuples = sorted(color_label_tuples, key=lambda x: x[1])
prev_next_tupels = zip(
list(ordered_color_label_tuples[0:-1]), list(ordered_color_label_tuples[1:])
list(ordered_color_label_tuples[0:-1]),
list(ordered_color_label_tuples[1:]),
strict=True,
)
for prev, nxt in prev_next_tupels:
# labels and colors are ordered strictly increasing
Expand Down Expand Up @@ -524,7 +526,7 @@ def test_bar_plot(self):
plot_bar = df.plot.bar()
assert all(
(a.get_text() == b.get_text())
for a, b in zip(plot_bar.get_xticklabels(), expected)
for a, b in zip(plot_bar.get_xticklabels(), expected, strict=True)
)

def test_barh_plot_labels_mixed_integer_string(self):
Expand All @@ -539,7 +541,7 @@ def test_barh_plot_labels_mixed_integer_string(self):
assert all(
actual.get_text() == expected.get_text()
for actual, expected in zip(
plot_barh.get_yticklabels(), expected_yticklabels
plot_barh.get_yticklabels(), expected_yticklabels, strict=True
)
)

Expand Down Expand Up @@ -681,7 +683,7 @@ def test_bar_plt_xaxis_intervalrange(self):
_check_plot_works(s.plot.bar)
assert all(
(a.get_text() == b.get_text())
for a, b in zip(s.plot.bar().get_xticklabels(), expected)
for a, b in zip(s.plot.bar().get_xticklabels(), expected, strict=True)
)


Expand Down
Loading