summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/test/runtktests.py10
-rw-r--r--Lib/tkinter/test/test_ttk/test_extensions.py5
2 files changed, 6 insertions, 9 deletions
diff --git a/Lib/tkinter/test/runtktests.py b/Lib/tkinter/test/runtktests.py
index 7067594..3d9775b 100644
--- a/Lib/tkinter/test/runtktests.py
+++ b/Lib/tkinter/test/runtktests.py
@@ -9,6 +9,7 @@ Extensions also should live in packages following the same rule as above.
import os
import sys
import unittest
+import importlib
import test.support
this_dir_path = os.path.abspath(os.path.dirname(__file__))
@@ -44,13 +45,8 @@ def get_tests_modules(basepath=this_dir_path, gui=True, packages=None):
for name in filenames:
try:
- yield __import__(
- "%s.%s.%s" % (
- "tkinter.test",
- pkg_name,
- name[:-len(py_ext)]),
- fromlist=['']
- )
+ yield importlib.import_module(
+ ".%s" % name[:-len(py_ext)], pkg_name)
except test.support.ResourceDenied:
if gui:
raise
diff --git a/Lib/tkinter/test/test_ttk/test_extensions.py b/Lib/tkinter/test/test_ttk/test_extensions.py
index a14ccca..9e52fc6 100644
--- a/Lib/tkinter/test/test_ttk/test_extensions.py
+++ b/Lib/tkinter/test/test_ttk/test_extensions.py
@@ -167,14 +167,15 @@ class LabeledScaleTest(unittest.TestCase):
x.update()
width, height = x.master.winfo_width(), x.master.winfo_height()
- width, height = width * 2, height * 2
+ width_new, height_new = width * 2, height * 2
x.value = 3
x.update()
- x.master.wm_geometry("%dx%d" % (width, height))
+ x.master.wm_geometry("%dx%d" % (width_new, height_new))
self.failUnlessEqual(int(x.label.place_info()['x']),
x.scale.coords()[0])
+ # Reset geometry
x.master.wm_geometry("%dx%d" % (width, height))
x.destroy()