mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
ee55826072
commit
d00aff2f62
15 changed files with 231 additions and 271 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue