Skip to content

Commit 40fe35a

Browse files
Issue #25263: Fixed the tkinter.test.test_tkinter.test_font.FontTest test
failure when the test is ran the second time. The root attribute was set in parent class in setUpClass and then overridded in child class in tearDownClass.
1 parent fed16ec commit 40fe35a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/tkinter/test/support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def setUpClass(cls):
2323
def tearDownClass(cls):
2424
cls.root.update_idletasks()
2525
cls.root.destroy()
26-
cls.root = None
26+
del cls.root
2727
tkinter._default_root = None
2828
tkinter._support_default_root = cls._old_support_default_root
2929

Lib/tkinter/test/test_tkinter/test_font.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class FontTest(AbstractTkTest, unittest.TestCase):
1212

1313
@classmethod
1414
def setUpClass(cls):
15-
AbstractTkTest.setUpClass()
15+
AbstractTkTest.setUpClass.__func__(cls)
1616
try:
1717
cls.font = font.Font(root=cls.root, name=fontname, exists=True)
1818
except tkinter.TclError:

0 commit comments

Comments
 (0)