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:
Serhiy Storchaka 2014-08-24 09:07:47 +03:00
parent ee55826072
commit d00aff2f62
15 changed files with 231 additions and 271 deletions

View file

@ -2,15 +2,15 @@ import unittest
import tkinter
from tkinter import ttk
from test.support import requires, run_unittest
import tkinter.test.support as support
from tkinter.test.support import AbstractTkTest
requires('gui')
class StyleTest(unittest.TestCase):
class StyleTest(AbstractTkTest, unittest.TestCase):
def setUp(self):
self.style = ttk.Style()
super().setUp()
self.style = ttk.Style(self.root)
def test_configure(self):
@ -25,7 +25,7 @@ class StyleTest(unittest.TestCase):
style = self.style
style.map('TButton', background=[('active', 'background', 'blue')])
self.assertEqual(style.map('TButton', 'background'),
[('active', 'background', 'blue')] if style.tk.wantobjects() else
[('active', 'background', 'blue')] if self.wantobjects else
[('active background', 'blue')])
self.assertIsInstance(style.map('TButton'), dict)