mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
Merged revisions 69141,69211-69212 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r69141 | benjamin.peterson | 2009-01-31 14:01:48 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation ........ r69211 | guilherme.polo | 2009-02-02 14:23:29 -0600 (Mon, 02 Feb 2009) | 1 line Restore the previous geometry before leaving the test ........ r69212 | guilherme.polo | 2009-02-02 14:28:59 -0600 (Mon, 02 Feb 2009) | 1 line Moving to importlib ........
This commit is contained in:
parent
7f9876c0da
commit
063ff65e2c
3 changed files with 28 additions and 31 deletions
|
@ -676,4 +676,4 @@ which incur interpreter overhead.
|
||||||
"List unique elements, preserving order. Remember only the element just seen."
|
"List unique elements, preserving order. Remember only the element just seen."
|
||||||
# unique_justseen('AAAABBBCCDAABBB') --> A B C D A B
|
# unique_justseen('AAAABBBCCDAABBB') --> A B C D A B
|
||||||
# unique_justseen('ABBCcAD', str.lower) --> A B C A D
|
# unique_justseen('ABBCcAD', str.lower) --> A B C A D
|
||||||
return map(next, map(itemgetter(1), groupby(iterable, key)))
|
return map(next, imap(itemgetter(1), groupby(iterable, key)))
|
||||||
|
|
|
@ -9,6 +9,7 @@ Extensions also should live in packages following the same rule as above.
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
import importlib
|
||||||
import test.support
|
import test.support
|
||||||
|
|
||||||
this_dir_path = os.path.abspath(os.path.dirname(__file__))
|
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:
|
for name in filenames:
|
||||||
try:
|
try:
|
||||||
yield __import__(
|
yield importlib.import_module(
|
||||||
"%s.%s.%s" % (
|
".%s" % name[:-len(py_ext)], pkg_name)
|
||||||
"tkinter.test",
|
|
||||||
pkg_name,
|
|
||||||
name[:-len(py_ext)]),
|
|
||||||
fromlist=['']
|
|
||||||
)
|
|
||||||
except test.support.ResourceDenied:
|
except test.support.ResourceDenied:
|
||||||
if gui:
|
if gui:
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -167,14 +167,15 @@ class LabeledScaleTest(unittest.TestCase):
|
||||||
x.update()
|
x.update()
|
||||||
|
|
||||||
width, height = x.master.winfo_width(), x.master.winfo_height()
|
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.value = 3
|
||||||
x.update()
|
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']),
|
self.failUnlessEqual(int(x.label.place_info()['x']),
|
||||||
x.scale.coords()[0])
|
x.scale.coords()[0])
|
||||||
|
|
||||||
|
# Reset geometry
|
||||||
x.master.wm_geometry("%dx%d" % (width, height))
|
x.master.wm_geometry("%dx%d" % (width, height))
|
||||||
x.destroy()
|
x.destroy()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue