mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Issue #27732: Silence test_idle with dummy bell functions.
This commit is contained in:
parent
40f70d1c05
commit
3ff55a8155
10 changed files with 32 additions and 23 deletions
|
|
@ -7,7 +7,7 @@
|
|||
from tkinter import Tk, Text
|
||||
from idlelib.idle_test.mock_tk import Mbox
|
||||
import idlelib.searchengine as se
|
||||
import idlelib.replace as rd
|
||||
from idlelib.replace import ReplaceDialog
|
||||
|
||||
orig_mbox = se.tkMessageBox
|
||||
showerror = Mbox.showerror
|
||||
|
|
@ -21,7 +21,8 @@ def setUpClass(cls):
|
|||
cls.root.withdraw()
|
||||
se.tkMessageBox = Mbox
|
||||
cls.engine = se.SearchEngine(cls.root)
|
||||
cls.dialog = rd.ReplaceDialog(cls.root, cls.engine)
|
||||
cls.dialog = ReplaceDialog(cls.root, cls.engine)
|
||||
cls.dialog.bell = lambda: None
|
||||
cls.dialog.ok = Mock()
|
||||
cls.text = Text(cls.root)
|
||||
cls.text.undo_block_start = Mock()
|
||||
|
|
@ -70,7 +71,6 @@ def test_replace_simple(self):
|
|||
# text found and replaced
|
||||
pv.set('a')
|
||||
rv.set('asdf')
|
||||
self.dialog.open(self.text)
|
||||
replace()
|
||||
equal(text.get('1.8', '1.12'), 'asdf')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue