diff options
author | Zackery Spytz <zspytz@gmail.com> | 2021-01-28 23:13:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 23:13:22 (GMT) |
commit | 23a567c11ca36eedde0e119443c85cc16075deaf (patch) | |
tree | e0081288c0a71ed629d729107a820d1d7a0349bc /Lib/idlelib/idle_test | |
parent | 64fc105b2d2faaeadd1026d2417b83915af6622f (diff) | |
download | cpython-23a567c11ca36eedde0e119443c85cc16075deaf.zip cpython-23a567c11ca36eedde0e119443c85cc16075deaf.tar.gz cpython-23a567c11ca36eedde0e119443c85cc16075deaf.tar.bz2 |
bpo-23544: Disable IDLE Stack Viewer when running user code (GH-17163)
Starting stack viewer when user code is running, including when Debugger is active, hangs or crashes IDLE.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_mainmenu.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_mainmenu.py b/Lib/idlelib/idle_test/test_mainmenu.py index 7ec0368..51d2acc 100644 --- a/Lib/idlelib/idle_test/test_mainmenu.py +++ b/Lib/idlelib/idle_test/test_mainmenu.py @@ -2,6 +2,7 @@ # Reported as 88%; mocking turtledemo absence would have no point. from idlelib import mainmenu +import re import unittest @@ -16,6 +17,26 @@ class MainMenuTest(unittest.TestCase): def test_default_keydefs(self): self.assertGreaterEqual(len(mainmenu.default_keydefs), 50) + def test_tcl_indexes(self): + # Test tcl patterns used to find menuitem to alter. + # On failure, change pattern here and in function(s). + # Patterns here have '.*' for re instead of '*' for tcl. + for menu, pattern in ( + ('debug', '.*tack.*iewer'), # PyShell.debug_menu_postcommand + ('options', '.*ode.*ontext'), # EW.__init__, CodeContext.toggle... + ('options', '.*ine.*umbers'), # EW.__init__, EW.toggle...event. + ): + with self.subTest(menu=menu, pattern=pattern): + for menutup in mainmenu.menudefs: + if menutup[0] == menu: + break + else: + self.assertTrue(0, f"{menu} not in menudefs") + self.assertTrue(any(re.search(pattern, menuitem[0]) + for menuitem in menutup[1] + if menuitem is not None), # Separator. + f"{pattern} not in {menu}") + if __name__ == '__main__': unittest.main(verbosity=2) |