Skip to content

Commit d065e30

Browse files
[3.11] IDLE: Fix test_debugger bug and buildbot failures (GH-112258) (#112260)
IDLE: Fix test_debugger bug and buildbot failures (GH-112258) Missing "requires('gui')" causes Tk() to fail when no gui. This caused CI Hypothesis test to fail, but I did not understand the its error message. Then buildbots failed. IdbTest failed on draft Bdb replacement because so different. Simplified version works on old and new. (cherry picked from commit 14fd86a) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent e19d75d commit d065e30

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Lib/idlelib/idle_test/test_debugger.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
"Test debugger, coverage 19%"
1+
"""Test debugger, coverage 66%
2+
3+
Try to make tests pass with draft bdbx, which may replace bdb in 3.13+.
4+
"""
25

36
from idlelib import debugger
47
from collections import namedtuple
@@ -44,10 +47,8 @@ def setUpClass(cls):
4447
cls.msg = 'file.py:2: <module>()'
4548

4649
def test_init(self):
47-
# Test that Idb.__init_ calls Bdb.__init__.
48-
idb = debugger.Idb(None)
49-
self.assertIsNone(idb.gui)
50-
self.assertTrue(hasattr(idb, 'breaks'))
50+
self.assertIs(self.idb.gui, self.gui)
51+
# Won't test super call since two Bdbs are very different.
5152

5253
def test_user_line(self):
5354
# Test that .user_line() creates a string message for a frame.
@@ -279,6 +280,7 @@ class NameSpaceTest(unittest.TestCase):
279280

280281
@classmethod
281282
def setUpClass(cls):
283+
requires('gui')
282284
cls.root = Tk()
283285
cls.root.withdraw()
284286

0 commit comments

Comments
 (0)