Commit aee0b85e authored by Serhiy Storchaka's avatar Serhiy Storchaka

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.
parent 7e4b5e51
...@@ -23,7 +23,7 @@ class AbstractTkTest: ...@@ -23,7 +23,7 @@ class AbstractTkTest:
def tearDownClass(cls): def tearDownClass(cls):
cls.root.update_idletasks() cls.root.update_idletasks()
cls.root.destroy() cls.root.destroy()
cls.root = None del cls.root
tkinter._default_root = None tkinter._default_root = None
tkinter._support_default_root = cls._old_support_default_root tkinter._support_default_root = cls._old_support_default_root
......
...@@ -12,7 +12,7 @@ class FontTest(AbstractTkTest, unittest.TestCase): ...@@ -12,7 +12,7 @@ class FontTest(AbstractTkTest, unittest.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
AbstractTkTest.setUpClass() AbstractTkTest.setUpClass.__func__(cls)
try: try:
cls.font = font.Font(root=cls.root, name=fontname, exists=True) cls.font = font.Font(root=cls.root, name=fontname, exists=True)
except tkinter.TclError: except tkinter.TclError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment