summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-08-06 11:51:29 (GMT)
committerGitHub <noreply@github.com>2020-08-06 11:51:29 (GMT)
commit79bb2c93f2d81702fdf1f93720369e18a76b7d1a (patch)
tree6ab9d0c6ef07954cc871dd6eb06f3a80329d33e6 /Lib/tkinter
parent52f98424a55e14f05dfa7483cc0faf634a61c9ff (diff)
downloadcpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.zip
cpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.tar.gz
cpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.tar.bz2
bpo-40275: Use new test.support helper submodules in tests (GH-21743)
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/test/test_tkinter/test_images.py11
-rw-r--r--Lib/tkinter/test/test_tkinter/test_loadtk.py3
2 files changed, 8 insertions, 6 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_images.py b/Lib/tkinter/test/test_tkinter/test_images.py
index 2805d35..6c6cb4e 100644
--- a/Lib/tkinter/test/test_tkinter/test_images.py
+++ b/Lib/tkinter/test/test_tkinter/test_images.py
@@ -1,6 +1,7 @@
import unittest
import tkinter
from test import support
+from test.support import os_helper
from tkinter.test.support import AbstractTkTest, requires_tcl
support.requires('gui')
@@ -296,12 +297,12 @@ class PhotoImageTest(AbstractTkTest, unittest.TestCase):
def test_write(self):
image = self.create()
- self.addCleanup(support.unlink, support.TESTFN)
+ self.addCleanup(os_helper.unlink, os_helper.TESTFN)
- image.write(support.TESTFN)
+ image.write(os_helper.TESTFN)
image2 = tkinter.PhotoImage('::img::test2', master=self.root,
format='ppm',
- file=support.TESTFN)
+ file=os_helper.TESTFN)
self.assertEqual(str(image2), '::img::test2')
self.assertEqual(image2.type(), 'photo')
self.assertEqual(image2.width(), 16)
@@ -309,10 +310,10 @@ class PhotoImageTest(AbstractTkTest, unittest.TestCase):
self.assertEqual(image2.get(0, 0), image.get(0, 0))
self.assertEqual(image2.get(15, 8), image.get(15, 8))
- image.write(support.TESTFN, format='gif', from_coords=(4, 6, 6, 9))
+ image.write(os_helper.TESTFN, format='gif', from_coords=(4, 6, 6, 9))
image3 = tkinter.PhotoImage('::img::test3', master=self.root,
format='gif',
- file=support.TESTFN)
+ file=os_helper.TESTFN)
self.assertEqual(str(image3), '::img::test3')
self.assertEqual(image3.type(), 'photo')
self.assertEqual(image3.width(), 2)
diff --git a/Lib/tkinter/test/test_tkinter/test_loadtk.py b/Lib/tkinter/test/test_tkinter/test_loadtk.py
index bab7bcd..760ba72 100644
--- a/Lib/tkinter/test/test_tkinter/test_loadtk.py
+++ b/Lib/tkinter/test/test_tkinter/test_loadtk.py
@@ -2,6 +2,7 @@ import os
import sys
import unittest
import test.support as test_support
+from test.support import os_helper
from tkinter import Tcl, TclError
test_support.requires('gui')
@@ -24,7 +25,7 @@ class TkLoadTest(unittest.TestCase):
# XXX Maybe on tk older than 8.4.13 it would be possible,
# see tkinter.h.
return
- with test_support.EnvironmentVarGuard() as env:
+ with os_helper.EnvironmentVarGuard() as env:
if 'DISPLAY' in os.environ:
del env['DISPLAY']
# on some platforms, deleting environment variables