summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/tests
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib2to3/tests')
-rw-r--r--Lib/lib2to3/tests/benchmark.py2
-rwxr-xr-xLib/lib2to3/tests/pytree_idempotency.py2
-rwxr-xr-xLib/lib2to3/tests/test_fixers.py18
3 files changed, 17 insertions, 5 deletions
diff --git a/Lib/lib2to3/tests/benchmark.py b/Lib/lib2to3/tests/benchmark.py
index 3723f69..e0f3e68 100644
--- a/Lib/lib2to3/tests/benchmark.py
+++ b/Lib/lib2to3/tests/benchmark.py
@@ -13,7 +13,7 @@ import sys
from time import time
# Test imports
-from support import adjust_path
+from .support import adjust_path
adjust_path()
# Local imports
diff --git a/Lib/lib2to3/tests/pytree_idempotency.py b/Lib/lib2to3/tests/pytree_idempotency.py
index d83f5cc..eeffe50 100755
--- a/Lib/lib2to3/tests/pytree_idempotency.py
+++ b/Lib/lib2to3/tests/pytree_idempotency.py
@@ -7,7 +7,7 @@
__author__ = "Guido van Rossum <guido@python.org>"
# Support imports (need to be imported first)
-import support
+from . import support
# Python imports
import os
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py
index 0cd985c..e89ef4d 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)