Issue #27732: Silence test_idle with dummy bell functions.

This commit is contained in:
Terry Jan Reedy 2016-08-10 23:44:54 -04:00
parent 40f70d1c05
commit 3ff55a8155
10 changed files with 32 additions and 23 deletions

View file

@ -31,6 +31,7 @@ class AutoExpand:
def __init__(self, editwin):
self.text = editwin.text
self.bell = self.text.bell
self.state = None
def expand_word_event(self, event):
@ -46,14 +47,14 @@ class AutoExpand:
words = self.getwords()
index = 0
if not words:
self.text.bell()
self.bell()
return "break"
word = self.getprevword()
self.text.delete("insert - %d chars" % len(word), "insert")
newword = words[index]
index = (index + 1) % len(words)
if index == 0:
self.text.bell() # Warn we cycled around
self.bell() # Warn we cycled around
self.text.insert("insert", newword)
curinsert = self.text.index("insert")
curline = self.text.get("insert linestart", "insert lineend")
@ -99,6 +100,7 @@ class AutoExpand:
i = i-1
return line[i:]
if __name__ == '__main__':
import unittest
unittest.main('idlelib.idle_test.test_autoexpand', verbosity=2)