diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-03-24 00:50:58 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-03-24 00:50:58 (GMT) |
commit | a675ef1141e2533bd5596222d0a64b6a3f74d2d0 (patch) | |
tree | 3f26e263209e15f5c885538eed005e9aaa736351 /Lib/lib2to3/tests/test_fixers.py | |
parent | fe337bfd0d89c62917e3625111c65f4aa187c6b4 (diff) | |
download | cpython-a675ef1141e2533bd5596222d0a64b6a3f74d2d0.zip cpython-a675ef1141e2533bd5596222d0a64b6a3f74d2d0.tar.gz cpython-a675ef1141e2533bd5596222d0a64b6a3f74d2d0.tar.bz2 |
Merged revisions 61825 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
................
r61825 | martin.v.loewis | 2008-03-24 01:46:53 +0100 (Mo, 24 Mär 2008) | 17 lines
Merged revisions 61724-61824 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r61730 | martin.v.loewis | 2008-03-22 02:20:58 +0100 (Sa, 22 Mär 2008) | 2 lines
More explicit relative imports.
........
r61755 | david.wolever | 2008-03-22 21:33:52 +0100 (Sa, 22 Mär 2008) | 1 line
Fixing #2446 -- 2to3 now translates 'import foo' to 'from . import foo'
........
r61824 | david.wolever | 2008-03-24 01:30:24 +0100 (Mo, 24 Mär 2008) | 3 lines
Fixed a bug where 'from itertools import izip' would return 'from itertools import'
........
................
Diffstat (limited to 'Lib/lib2to3/tests/test_fixers.py')
-rwxr-xr-x | Lib/lib2to3/tests/test_fixers.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py index 056e95b..34ea3e5 100755 --- a/Lib/lib2to3/tests/test_fixers.py +++ b/Lib/lib2to3/tests/test_fixers.py @@ -3036,6 +3036,10 @@ class Test_itertools_imports(FixerTestCase): a = "" self.check(b, a) + b = "from itertools import izip" + a = "" + self.check(b, a) + def test_import_as(self): b = "from itertools import izip, bar as bang, imap" a = "from itertools import bar as bang" @@ -3105,6 +3109,10 @@ class Test_import(FixerTestCase): self.failUnlessEqual(set(self.files_checked), expected_checks) def test_from(self): + b = "from foo import bar, baz" + a = "from .foo import bar, baz" + self.check_both(b, a) + b = "from foo import bar" a = "from .foo import bar" self.check_both(b, a) @@ -3121,17 +3129,21 @@ class Test_import(FixerTestCase): def test_import(self): b = "import foo" - a = "import .foo" + a = "from . import foo" + self.check_both(b, a) + + b = "import foo, bar" + a = "from . import foo, bar" self.check_both(b, a) def test_dotted_import(self): b = "import foo.bar" - a = "import .foo.bar" + a = "from . import foo.bar" self.check_both(b, a) def test_dotted_import_as(self): b = "import foo.bar as bang" - a = "import .foo.bar as bang" + a = "from . import foo.bar as bang" self.check_both(b, a) |