summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/test/test_tkinter/test_images.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-08-24 06:07:47 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-08-24 06:07:47 (GMT)
commitd00aff2f62481c3e8cf3b8e9cbbaf888361ffdd4 (patch)
treeb76421157985cf86b00a39f3b652765667d96adb /Lib/tkinter/test/test_tkinter/test_images.py
parentee558260727d160d43b14fc01851f73ef94ea587 (diff)
downloadcpython-d00aff2f62481c3e8cf3b8e9cbbaf888361ffdd4.zip
cpython-d00aff2f62481c3e8cf3b8e9cbbaf888361ffdd4.tar.gz
cpython-d00aff2f62481c3e8cf3b8e9cbbaf888361ffdd4.tar.bz2
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_images.py')
-rw-r--r--Lib/tkinter/test/test_tkinter/test_images.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_images.py b/Lib/tkinter/test/test_tkinter/test_images.py
index ff05bbe..85a8cd0 100644
--- a/Lib/tkinter/test/test_tkinter/test_images.py
+++ b/Lib/tkinter/test/test_tkinter/test_images.py
@@ -1,16 +1,12 @@
import unittest
import tkinter
-from tkinter import ttk
from test import support
-from tkinter.test.support import requires_tcl
+from tkinter.test.support import AbstractTkTest, requires_tcl
support.requires('gui')
-class MiscTest(unittest.TestCase):
-
- def setUp(self):
- self.root = ttk.setup_master()
+class MiscTest(AbstractTkTest, unittest.TestCase):
def test_image_types(self):
image_types = self.root.image_types()
@@ -23,15 +19,13 @@ class MiscTest(unittest.TestCase):
self.assertIsInstance(image_names, tuple)
-class BitmapImageTest(unittest.TestCase):
+class BitmapImageTest(AbstractTkTest, unittest.TestCase):
@classmethod
def setUpClass(cls):
+ AbstractTkTest.setUpClass.__func__(cls)
cls.testfile = support.findfile('python.xbm', subdir='imghdrdata')
- def setUp(self):
- self.root = ttk.setup_master()
-
def test_create_from_file(self):
image = tkinter.BitmapImage('::img::test', master=self.root,
foreground='yellow', background='blue',
@@ -107,16 +101,13 @@ class BitmapImageTest(unittest.TestCase):
'-foreground {} {} #000000 yellow')
-class PhotoImageTest(unittest.TestCase):
+class PhotoImageTest(AbstractTkTest, unittest.TestCase):
@classmethod
def setUpClass(cls):
+ AbstractTkTest.setUpClass.__func__(cls)
cls.testfile = support.findfile('python.gif', subdir='imghdrdata')
- def setUp(self):
- self.root = ttk.setup_master()
- self.wantobjects = self.root.wantobjects()
-
def create(self):
return tkinter.PhotoImage('::img::test', master=self.root,
file=self.testfile)