]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
IDLE: Fix test_debugger bug and buildbot failures (#112258)
authorTerry Jan Reedy <tjreedy@udel.edu>
Sun, 19 Nov 2023 06:39:26 +0000 (01:39 -0500)
committerGitHub <noreply@github.com>
Sun, 19 Nov 2023 06:39:26 +0000 (06:39 +0000)
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.

Lib/idlelib/idle_test/test_debugger.py

index db01a893cb19808db8aea9cc4e11c21cf117dd6a..d1c9638dd5d711e39b13522d1e2a74cac136a85a 100644 (file)
@@ -1,4 +1,7 @@
-"Test debugger, coverage 19%"
+"""Test debugger, coverage 66%
+
+Try to make tests pass with draft bdbx, which may replace bdb in 3.13+.
+"""
 
 from idlelib import debugger
 from collections import namedtuple
@@ -44,10 +47,8 @@ class IdbTest(unittest.TestCase):
         cls.msg = 'file.py:2: <module>()'
 
     def test_init(self):
-        # Test that Idb.__init_ calls Bdb.__init__.
-        idb = debugger.Idb(None)
-        self.assertIsNone(idb.gui)
-        self.assertTrue(hasattr(idb, 'breaks'))
+        self.assertIs(self.idb.gui, self.gui)
+        # Won't test super call since two Bdbs are very different.
 
     def test_user_line(self):
         # Test that .user_line() creates a string message for a frame.
@@ -279,6 +280,7 @@ class NameSpaceTest(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
+        requires('gui')
         cls.root = Tk()
         cls.root.withdraw()