Skip to content

Commit 92608ca

Browse files
authored
Update test_widgets.py
1 parent 480f002 commit 92608ca

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/matplotlib/tests/test_widgets.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,22 +339,23 @@ def test_TextBox():
339339
submit_event = Mock()
340340
text_change_event = Mock()
341341
ax = get_ax()
342-
343-
tool = widgets.TextBox(ax, 'Evaluate')
342+
tool = widgets.TextBox(ax, '')
344343
tool.on_submit(submit_event)
345344
tool.on_text_change(text_change_event)
346-
tool.set_val('')
347345

348346
assert tool.text == ''
349-
assert text_change_event.call_count == 1
350347

351348
do_event(tool, '_click')
349+
352350
tool.set_val('x**2')
351+
352+
assert text_change_event.call_count == 1
353+
353354
tool.begin_typing(tool.text)
354355
tool.stop_typing()
355356

356-
assert submit_event.call_count == 3
357-
357+
assert submit_event.call_count == 2
358+
358359
do_event(tool, '_click')
359360
do_event(tool, '_keypress', key='+')
360361
do_event(tool, '_keypress', key='5')

0 commit comments

Comments
 (0)