summaryrefslogtreecommitdiff
path: root/Lib/tkinter/test/test_tkinter/test_font.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-08-24 09:07:47 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2014-08-24 09:07:47 +0300
commitd00aff2f62481c3e8cf3b8e9cbbaf888361ffdd4 (patch)
treeb76421157985cf86b00a39f3b652765667d96adb /Lib/tkinter/test/test_tkinter/test_font.py
parentee558260727d160d43b14fc01851f73ef94ea587 (diff)
downloadcpython-git-d00aff2f62481c3e8cf3b8e9cbbaf888361ffdd4.tar.gz
Issue #22236: Tkinter tests now don't reuse default root window. New root
window is created for every test class. Fixed Tkinter images copying operations in NoDefaultRoot mode. Tcl command names generated for "after" callbacks now contains a name of original function.
Diffstat (limited to 'Lib/tkinter/test/test_tkinter/test_font.py')
-rw-r--r--Lib/tkinter/test/test_tkinter/test_font.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_font.py b/Lib/tkinter/test/test_tkinter/test_font.py
index dfd630b4de..09c963ee38 100644
--- a/Lib/tkinter/test/test_tkinter/test_font.py
+++ b/Lib/tkinter/test/test_tkinter/test_font.py
@@ -2,26 +2,20 @@ import unittest
import tkinter
from tkinter import font
from test.support import requires, run_unittest
-import tkinter.test.support as support
+from tkinter.test.support import AbstractTkTest
requires('gui')
-class FontTest(unittest.TestCase):
-
- def setUp(self):
- support.root_deiconify()
-
- def tearDown(self):
- support.root_withdraw()
+class FontTest(AbstractTkTest, unittest.TestCase):
def test_font_eq(self):
fontname = "TkDefaultFont"
try:
- f = font.Font(name=fontname, exists=True)
+ f = font.Font(root=self.root, name=fontname, exists=True)
except tkinter._tkinter.TclError:
- f = font.Font(name=fontname, exists=False)
- font1 = font.nametofont(fontname)
- font2 = font.nametofont(fontname)
+ f = font.Font(root=self.root, name=fontname, exists=False)
+ font1 = font.Font(root=self.root, name=fontname, exists=True)
+ font2 = font.Font(root=self.root, name=fontname, exists=True)
self.assertIsNot(font1, font2)
self.assertEqual(font1, font2)
self.assertNotEqual(font1, font1.copy())