We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a62c25f commit 6ef9cceCopy full SHA for 6ef9cce
lib/matplotlib/tests/test_legend.py
@@ -1452,10 +1452,8 @@ def test_boxplot_legend():
1452
lbl_index += 1
1453
1454
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
+ for index, handle in enumerate(legend.legend_handles):
+ assert isinstance(handle, mpl.patches.Rectangle)
+ assert handle.get_facecolor() == colors[index]
+ assert handle.get_edgecolor() == colors[index]
+ assert handle.get_label() == labels[index]
0 commit comments