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