Skip to content

Commit 070ef27

Browse files
committed
Make MultiCursor test more explicit
1 parent 569a225 commit 070ef27

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/matplotlib/tests/test_widgets.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,10 +1494,8 @@ def test_polygon_selector_box(ax):
14941494
tool._box.extents, (20.0, 40.0, 30.0, 40.0))
14951495

14961496

1497-
@pytest.mark.parametrize(
1498-
"horizOn, vertOn",
1499-
[(True, True), (True, False), (False, True)],
1500-
)
1497+
@pytest.mark.parametrize("horizOn", [False, True])
1498+
@pytest.mark.parametrize("vertOn", [False, True])
15011499
def test_MultiCursor(horizOn, vertOn):
15021500
(ax1, ax3) = plt.figure().subplots(2, sharex=True)
15031501
ax2 = plt.figure().subplots()
@@ -1508,10 +1506,8 @@ def test_MultiCursor(horizOn, vertOn):
15081506
)
15091507

15101508
# Only two of the axes should have a line drawn on them.
1511-
if vertOn:
1512-
assert len(multi.vlines) == 2
1513-
if horizOn:
1514-
assert len(multi.hlines) == 2
1509+
assert len(multi.vlines) == (2 if vertOn else 0)
1510+
assert len(multi.hlines) == (2 if horizOn else 0)
15151511

15161512
# mock a motion_notify_event
15171513
# Can't use `do_event` as that helper requires the widget

0 commit comments

Comments
 (0)