Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6ef9cce

Browse filesBrowse files
committed
improve test code
1 parent a62c25f commit 6ef9cce
Copy full SHA for 6ef9cce

File tree

Expand file treeCollapse file tree

1 file changed

+5
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-7
lines changed

‎lib/matplotlib/tests/test_legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_legend.py
+5-7Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,10 +1452,8 @@ def test_boxplot_legend():
14521452
lbl_index += 1
14531453

14541454
legend = axs.legend()
1455-
index = 0
1456-
for i in legend.legend_handles:
1457-
assert isinstance(i, mpl.patches.Rectangle)
1458-
assert i.get_facecolor() == colors[index]
1459-
assert i.get_edgecolor() == colors[index]
1460-
assert i.get_label() == labels[index]
1461-
index += 1
1455+
for index, handle in enumerate(legend.legend_handles):
1456+
assert isinstance(handle, mpl.patches.Rectangle)
1457+
assert handle.get_facecolor() == colors[index]
1458+
assert handle.get_edgecolor() == colors[index]
1459+
assert handle.get_label() == labels[index]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.