]> granicus.if.org Git - python/commitdiff
Issue #25263: Fixed the tkinter.test.test_tkinter.test_font.FontTest test
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 10 Nov 2015 13:30:35 +0000 (15:30 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Tue, 10 Nov 2015 13:30:35 +0000 (15:30 +0200)
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.

Lib/tkinter/test/support.py
Lib/tkinter/test/test_tkinter/test_font.py

index 52df10400300941bad40a2a0aebf8e17714d7ec3..dd155fad0fd0b3c97f8067938de33d878ce770c6 100644 (file)
@@ -23,7 +23,7 @@ class AbstractTkTest:
     def tearDownClass(cls):
         cls.root.update_idletasks()
         cls.root.destroy()
-        cls.root = None
+        del cls.root
         tkinter._default_root = None
         tkinter._support_default_root = cls._old_support_default_root
 
index 25b59132add61678841340a301ba6cb24c8594ae..c094c61ce42a067b32d661248f5baf719e9099a3 100644 (file)
@@ -12,7 +12,7 @@ class FontTest(AbstractTkTest, unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        AbstractTkTest.setUpClass()
+        AbstractTkTest.setUpClass.__func__(cls)
         try:
             cls.font = font.Font(root=cls.root, name=fontname, exists=True)
         except tkinter.TclError: