Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dedcac3

Browse files
committed
Image comparison test for CheckButtons & RadioButtons
1 parent d428137 commit dedcac3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/matplotlib/tests/test_widgets.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import matplotlib.widgets as widgets
1111
import matplotlib.pyplot as plt
12-
from matplotlib.testing.decorators import cleanup
12+
from matplotlib.testing.decorators import cleanup, image_comparison
1313

1414
from numpy.testing import assert_allclose
1515

@@ -271,3 +271,15 @@ def clicked_function():
271271
pass
272272
cid = check.on_clicked(clicked_function)
273273
check.disconnect(cid)
274+
275+
276+
@image_comparison(baseline_images=['check_radio_buttons'], extensions=['png'],
277+
style='default')
278+
def test_check_radio_buttons_image():
279+
get_ax()
280+
plt.subplots_adjust(left=0.3)
281+
rax1 = plt.axes([0.05, 0.7, 0.15, 0.15])
282+
rax2 = plt.axes([0.05, 0.2, 0.15, 0.15])
283+
widgets.RadioButtons(rax1, ('Radio 1', 'Radio 2', 'Radio 3'))
284+
widgets.CheckButtons(rax2, ('Check 1', 'Check 2', 'Check 3'),
285+
(False, True, True))

0 commit comments

Comments
 (0)