summaryrefslogtreecommitdiff
path: root/Lib/tkinter/test/test_tkinter/test_font.py
diff options
context:
space:
mode:
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())