mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +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
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue