summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/tests
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-12-05 09:02:42 (GMT)
committerGeorg Brandl <georg@python.org>2008-12-05 09:02:42 (GMT)
commitc09315d639dee3bf62e50d9b979f9b2c8dcb8591 (patch)
tree132b59b49d00781c64a4837f6ca44795e7a371c6 /Lib/lib2to3/tests
parent441541f76728e93ecc0ce67c36dd6cee835c138f (diff)
downloadcpython-c09315d639dee3bf62e50d9b979f9b2c8dcb8591.zip
cpython-c09315d639dee3bf62e50d9b979f9b2c8dcb8591.tar.gz
cpython-c09315d639dee3bf62e50d9b979f9b2c8dcb8591.tar.bz2
Merged revisions 67376 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ................ r67376 | benjamin.peterson | 2008-11-25 05:07:45 +0100 (Tue, 25 Nov 2008) | 17 lines Merged revisions 67183,67191,67371 via svnmerge from svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67183 | benjamin.peterson | 2008-11-10 21:51:33 -0600 (Mon, 10 Nov 2008) | 1 line handle 'import x as y' in fix_imports; this still needs more work... ........ r67191 | benjamin.peterson | 2008-11-11 17:24:51 -0600 (Tue, 11 Nov 2008) | 1 line super() is good ........ r67371 | benjamin.peterson | 2008-11-24 16:02:00 -0600 (Mon, 24 Nov 2008) | 1 line don't blow up in the metaclass fixer when assignments in the class statement aren't simple ........ ................
Diffstat (limited to 'Lib/lib2to3/tests')
-rwxr-xr-xLib/lib2to3/tests/test_fixers.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py
index 1098d4c..209d5d7 100755
--- a/Lib/lib2to3/tests/test_fixers.py
+++ b/Lib/lib2to3/tests/test_fixers.py
@@ -2656,7 +2656,7 @@ class Test_map(FixerTestCase):
def check(self, b, a):
self.unchanged("from future_builtins import map; " + b, a)
- FixerTestCase.check(self, b, a)
+ super(Test_map, self).check(b, a)
def test_prefix_preservation(self):
b = """x = map( f, 'abc' )"""
@@ -2763,7 +2763,7 @@ class Test_zip(FixerTestCase):
def check(self, b, a):
self.unchanged("from future_builtins import zip; " + b, a)
- FixerTestCase.check(self, b, a)
+ super(Test_zip, self).check(b, a)
def test_zip_basic(self):
b = """x = zip(a, b, c)"""
@@ -3308,7 +3308,7 @@ class Test_import(FixerTestCase):
fixer = "import"
def setUp(self):
- FixerTestCase.setUp(self)
+ super(Test_import, self).setUp()
# Need to replace fix_import's exists method
# so we can check that it's doing the right thing
self.files_checked = []
@@ -3327,9 +3327,9 @@ class Test_import(FixerTestCase):
def check_both(self, b, a):
self.always_exists = True
- FixerTestCase.check(self, b, a)
+ super(Test_import, self).check(b, a)
self.always_exists = False
- FixerTestCase.unchanged(self, b)
+ super(Test_import, self).unchanged(b)
def test_files_checked(self):
def p(path):
@@ -3406,6 +3406,11 @@ class Test_import(FixerTestCase):
a = "from . import foo, bar"
self.check_both(b, a)
+ def test_import_as(self):
+ b = "import foo as x"
+ a = "from . import foo as x"
+ self.check_both(b, a)
+
def test_dotted_import(self):
b = "import foo.bar"
a = "from . import foo.bar"
@@ -3800,6 +3805,17 @@ class Test_metaclass(FixerTestCase):
"""
self.check(b, a)
+ b = """
+ class X:
+ __metaclass__ = Meta
+ save.py = 23
+ """
+ a = """
+ class X(metaclass=Meta):
+ save.py = 23
+ """
+ self.check(b, a)
+
class Test_getcwdu(FixerTestCase):