mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +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
|
@ -38,12 +38,17 @@ class ParenMatchTest(unittest.TestCase):
|
|||
def tearDown(self):
|
||||
self.text.delete('1.0', 'end')
|
||||
|
||||
def get_parenmatch(self):
|
||||
pm = ParenMatch(self.editwin)
|
||||
pm.bell = lambda: None
|
||||
return pm
|
||||
|
||||
def test_paren_expression(self):
|
||||
"""
|
||||
Test ParenMatch with 'expression' style.
|
||||
"""
|
||||
text = self.text
|
||||
pm = ParenMatch(self.editwin)
|
||||
pm = self.get_parenmatch()
|
||||
pm.set_style('expression')
|
||||
|
||||
text.insert('insert', 'def foobar(a, b')
|
||||
|
@ -66,7 +71,7 @@ class ParenMatchTest(unittest.TestCase):
|
|||
Test ParenMatch with 'default' style.
|
||||
"""
|
||||
text = self.text
|
||||
pm = ParenMatch(self.editwin)
|
||||
pm = self.get_parenmatch()
|
||||
pm.set_style('default')
|
||||
|
||||
text.insert('insert', 'def foobar(a, b')
|
||||
|
@ -86,7 +91,7 @@ class ParenMatchTest(unittest.TestCase):
|
|||
These cases force conditional expression and alternate paths.
|
||||
"""
|
||||
text = self.text
|
||||
pm = ParenMatch(self.editwin)
|
||||
pm = self.get_parenmatch()
|
||||
|
||||
text.insert('insert', '# this is a commen)')
|
||||
self.assertIsNone(pm.paren_closed_event('event'))
|
||||
|
@ -99,7 +104,7 @@ class ParenMatchTest(unittest.TestCase):
|
|||
self.assertIsNone(pm.paren_closed_event('event'))
|
||||
|
||||
def test_handle_restore_timer(self):
|
||||
pm = ParenMatch(self.editwin)
|
||||
pm = self.get_parenmatch()
|
||||
pm.restore_event = Mock()
|
||||
pm.handle_restore_timer(0)
|
||||
self.assertTrue(pm.restore_event.called)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue