diff options
| author | Terry Jan Reedy <tjreedy@udel.edu> | 2016-08-11 03:44:54 (GMT) |
|---|---|---|
| committer | Terry Jan Reedy <tjreedy@udel.edu> | 2016-08-11 03:44:54 (GMT) |
| commit | 3ff55a815559c91cfd8a7573e63ea6c3b7124484 (patch) | |
| tree | 18c062df6cfcbee9f33f37ab41b96406c97e7302 /Lib/idlelib/idle_test/test_parenmatch.py | |
| parent | 40f70d1c057fb61eb24724950c237cd4b45a8cf5 (diff) | |
| download | cpython-3ff55a815559c91cfd8a7573e63ea6c3b7124484.zip cpython-3ff55a815559c91cfd8a7573e63ea6c3b7124484.tar.gz cpython-3ff55a815559c91cfd8a7573e63ea6c3b7124484.tar.bz2 | |
Issue #27732: Silence test_idle with dummy bell functions.
Diffstat (limited to 'Lib/idlelib/idle_test/test_parenmatch.py')
| -rw-r--r-- | Lib/idlelib/idle_test/test_parenmatch.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/idlelib/idle_test/test_parenmatch.py b/Lib/idlelib/idle_test/test_parenmatch.py index d467a9a..051f7ea 100644 --- a/Lib/idlelib/idle_test/test_parenmatch.py +++ b/Lib/idlelib/idle_test/test_parenmatch.py @@ -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) |
