summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_lib2to3.py9
-rw-r--r--Lib/test/test_lib2to3/__init__.py (renamed from Lib/lib2to3/tests/__init__.py)0
-rw-r--r--Lib/test/test_lib2to3/__main__.py (renamed from Lib/lib2to3/tests/__main__.py)0
-rw-r--r--Lib/test/test_lib2to3/data/README (renamed from Lib/lib2to3/tests/data/README)0
-rw-r--r--Lib/test/test_lib2to3/data/bom.py (renamed from Lib/lib2to3/tests/data/bom.py)0
-rw-r--r--Lib/test/test_lib2to3/data/crlf.py (renamed from Lib/lib2to3/tests/data/crlf.py)0
-rwxr-xr-xLib/test/test_lib2to3/data/different_encoding.py (renamed from Lib/lib2to3/tests/data/different_encoding.py)0
-rwxr-xr-xLib/test/test_lib2to3/data/false_encoding.py (renamed from Lib/lib2to3/tests/data/false_encoding.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/bad_order.py (renamed from Lib/lib2to3/tests/data/fixers/bad_order.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/myfixes/__init__.py (renamed from Lib/lib2to3/tests/data/fixers/myfixes/__init__.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/myfixes/fix_explicit.py (renamed from Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/myfixes/fix_first.py (renamed from Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/myfixes/fix_last.py (renamed from Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/myfixes/fix_parrot.py (renamed from Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/myfixes/fix_preorder.py (renamed from Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/no_fixer_cls.py (renamed from Lib/lib2to3/tests/data/fixers/no_fixer_cls.py)0
-rw-r--r--Lib/test/test_lib2to3/data/fixers/parrot_example.py (renamed from Lib/lib2to3/tests/data/fixers/parrot_example.py)0
-rw-r--r--Lib/test/test_lib2to3/data/infinite_recursion.py (renamed from Lib/lib2to3/tests/data/infinite_recursion.py)0
-rw-r--r--Lib/test/test_lib2to3/data/py2_test_grammar.py (renamed from Lib/lib2to3/tests/data/py2_test_grammar.py)0
-rw-r--r--Lib/test/test_lib2to3/data/py3_test_grammar.py (renamed from Lib/lib2to3/tests/data/py3_test_grammar.py)0
-rwxr-xr-xLib/test/test_lib2to3/pytree_idempotency.py (renamed from Lib/lib2to3/tests/pytree_idempotency.py)6
-rw-r--r--Lib/test/test_lib2to3/support.py (renamed from Lib/lib2to3/tests/support.py)21
-rw-r--r--Lib/test/test_lib2to3/test_all_fixers.py (renamed from Lib/lib2to3/tests/test_all_fixers.py)0
-rw-r--r--Lib/test/test_lib2to3/test_fixers.py (renamed from Lib/lib2to3/tests/test_fixers.py)12
-rw-r--r--Lib/test/test_lib2to3/test_main.py (renamed from Lib/lib2to3/tests/test_main.py)0
-rw-r--r--Lib/test/test_lib2to3/test_parser.py (renamed from Lib/lib2to3/tests/test_parser.py)2
-rw-r--r--Lib/test/test_lib2to3/test_pytree.py (renamed from Lib/lib2to3/tests/test_pytree.py)0
-rw-r--r--Lib/test/test_lib2to3/test_refactor.py (renamed from Lib/lib2to3/tests/test_refactor.py)0
-rw-r--r--Lib/test/test_lib2to3/test_util.py (renamed from Lib/lib2to3/tests/test_util.py)0
29 files changed, 26 insertions, 24 deletions
diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py
deleted file mode 100644
index 6ea8aa4..0000000
--- a/Lib/test/test_lib2to3.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import unittest
-from test.support.import_helper import import_fresh_module
-from test.support.warnings_helper import check_warnings
-
-with check_warnings(("", DeprecationWarning)):
- load_tests = import_fresh_module('lib2to3.tests', fresh=['lib2to3']).load_tests
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/Lib/lib2to3/tests/__init__.py b/Lib/test/test_lib2to3/__init__.py
index f323c23..f323c23 100644
--- a/Lib/lib2to3/tests/__init__.py
+++ b/Lib/test/test_lib2to3/__init__.py
diff --git a/Lib/lib2to3/tests/__main__.py b/Lib/test/test_lib2to3/__main__.py
index 40a23a2..40a23a2 100644
--- a/Lib/lib2to3/tests/__main__.py
+++ b/Lib/test/test_lib2to3/__main__.py
diff --git a/Lib/lib2to3/tests/data/README b/Lib/test/test_lib2to3/data/README
index 7aa47e4..7aa47e4 100644
--- a/Lib/lib2to3/tests/data/README
+++ b/Lib/test/test_lib2to3/data/README
diff --git a/Lib/lib2to3/tests/data/bom.py b/Lib/test/test_lib2to3/data/bom.py
index 9bc3975..9bc3975 100644
--- a/Lib/lib2to3/tests/data/bom.py
+++ b/Lib/test/test_lib2to3/data/bom.py
diff --git a/Lib/lib2to3/tests/data/crlf.py b/Lib/test/test_lib2to3/data/crlf.py
index a83ca8f..a83ca8f 100644
--- a/Lib/lib2to3/tests/data/crlf.py
+++ b/Lib/test/test_lib2to3/data/crlf.py
diff --git a/Lib/lib2to3/tests/data/different_encoding.py b/Lib/test/test_lib2to3/data/different_encoding.py
index 9f32bd0..9f32bd0 100755
--- a/Lib/lib2to3/tests/data/different_encoding.py
+++ b/Lib/test/test_lib2to3/data/different_encoding.py
diff --git a/Lib/lib2to3/tests/data/false_encoding.py b/Lib/test/test_lib2to3/data/false_encoding.py
index f4e59e7..f4e59e7 100755
--- a/Lib/lib2to3/tests/data/false_encoding.py
+++ b/Lib/test/test_lib2to3/data/false_encoding.py
diff --git a/Lib/lib2to3/tests/data/fixers/bad_order.py b/Lib/test/test_lib2to3/data/fixers/bad_order.py
index 061bbf2..061bbf2 100644
--- a/Lib/lib2to3/tests/data/fixers/bad_order.py
+++ b/Lib/test/test_lib2to3/data/fixers/bad_order.py
diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py b/Lib/test/test_lib2to3/data/fixers/myfixes/__init__.py
index e69de29..e69de29 100644
--- a/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py
+++ b/Lib/test/test_lib2to3/data/fixers/myfixes/__init__.py
diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_explicit.py
index cbe16f6..cbe16f6 100644
--- a/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py
+++ b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_explicit.py
diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_first.py
index a88821f..a88821f 100644
--- a/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py
+++ b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_first.py
diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_last.py
index 9a077d4..9a077d4 100644
--- a/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py
+++ b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_last.py
diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_parrot.py
index 6db79ad..6db79ad 100644
--- a/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py
+++ b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_parrot.py
diff --git a/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_preorder.py
index b9bfbba..b9bfbba 100644
--- a/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py
+++ b/Lib/test/test_lib2to3/data/fixers/myfixes/fix_preorder.py
diff --git a/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py b/Lib/test/test_lib2to3/data/fixers/no_fixer_cls.py
index 506f794..506f794 100644
--- a/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py
+++ b/Lib/test/test_lib2to3/data/fixers/no_fixer_cls.py
diff --git a/Lib/lib2to3/tests/data/fixers/parrot_example.py b/Lib/test/test_lib2to3/data/fixers/parrot_example.py
index 0852928..0852928 100644
--- a/Lib/lib2to3/tests/data/fixers/parrot_example.py
+++ b/Lib/test/test_lib2to3/data/fixers/parrot_example.py
diff --git a/Lib/lib2to3/tests/data/infinite_recursion.py b/Lib/test/test_lib2to3/data/infinite_recursion.py
index acc62ed..acc62ed 100644
--- a/Lib/lib2to3/tests/data/infinite_recursion.py
+++ b/Lib/test/test_lib2to3/data/infinite_recursion.py
diff --git a/Lib/lib2to3/tests/data/py2_test_grammar.py b/Lib/test/test_lib2to3/data/py2_test_grammar.py
index f9e4ea1..f9e4ea1 100644
--- a/Lib/lib2to3/tests/data/py2_test_grammar.py
+++ b/Lib/test/test_lib2to3/data/py2_test_grammar.py
diff --git a/Lib/lib2to3/tests/data/py3_test_grammar.py b/Lib/test/test_lib2to3/data/py3_test_grammar.py
index a4a3f7e..a4a3f7e 100644
--- a/Lib/lib2to3/tests/data/py3_test_grammar.py
+++ b/Lib/test/test_lib2to3/data/py3_test_grammar.py
diff --git a/Lib/lib2to3/tests/pytree_idempotency.py b/Lib/test/test_lib2to3/pytree_idempotency.py
index 2e7e978..eb2e2aa 100755
--- a/Lib/lib2to3/tests/pytree_idempotency.py
+++ b/Lib/test/test_lib2to3/pytree_idempotency.py
@@ -17,9 +17,9 @@ import sys
import logging
# Local imports
-from .. import pytree
-from .. import pgen2
-from ..pgen2 import driver
+from lib2to3 import pytree
+from lib2to3 import pgen2
+from lib2to3.pgen2 import driver
logging.basicConfig()
diff --git a/Lib/lib2to3/tests/support.py b/Lib/test/test_lib2to3/support.py
index fe084e8..9e56273 100644
--- a/Lib/lib2to3/tests/support.py
+++ b/Lib/test/test_lib2to3/support.py
@@ -8,12 +8,14 @@ import os.path
from textwrap import dedent
# Local imports
+import lib2to3
from lib2to3 import pytree, refactor
from lib2to3.pgen2 import driver as pgen2_driver
+lib2to3_dir = os.path.dirname(lib2to3.__file__)
test_dir = os.path.dirname(__file__)
proj_dir = os.path.normpath(os.path.join(test_dir, ".."))
-grammar_path = os.path.join(test_dir, "..", "Grammar.txt")
+grammar_path = os.path.join(lib2to3_dir, "Grammar.txt")
grammar = pgen2_driver.load_grammar(grammar_path)
grammar_no_print_statement = pgen2_driver.load_grammar(grammar_path)
del grammar_no_print_statement.keywords["print"]
@@ -49,10 +51,19 @@ def get_refactorer(fixer_pkg="lib2to3", fixers=None, options=None):
options = options or {}
return refactor.RefactoringTool(fixers, options, explicit=True)
-def all_project_files():
- for dirpath, dirnames, filenames in os.walk(proj_dir):
+def _all_project_files(root, files):
+ for dirpath, dirnames, filenames in os.walk(root):
for filename in filenames:
- if filename.endswith(".py"):
- yield os.path.join(dirpath, filename)
+ if not filename.endswith(".py"):
+ continue
+ files.append(os.path.join(dirpath, filename))
+
+def all_project_files():
+ files = []
+ _all_project_files(lib2to3_dir, files)
+ _all_project_files(test_dir, files)
+ # Sort to get more reproducible tests
+ files.sort()
+ return files
TestCase = unittest.TestCase
diff --git a/Lib/lib2to3/tests/test_all_fixers.py b/Lib/test/test_lib2to3/test_all_fixers.py
index d0fca70..d0fca70 100644
--- a/Lib/lib2to3/tests/test_all_fixers.py
+++ b/Lib/test/test_lib2to3/test_all_fixers.py
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/test/test_lib2to3/test_fixers.py
index 121ebe6..68efeee 100644
--- a/Lib/lib2to3/tests/test_fixers.py
+++ b/Lib/test/test_lib2to3/test_fixers.py
@@ -7,7 +7,7 @@ from operator import itemgetter
# Local imports
from lib2to3 import pygram, fixer_util
-from lib2to3.tests import support
+from test.test_lib2to3 import support
class FixerTestCase(support.TestCase):
@@ -1791,7 +1791,7 @@ class ImportsFixerTests:
class Test_imports(FixerTestCase, ImportsFixerTests):
fixer = "imports"
- from ..fixes.fix_imports import MAPPING as modules
+ from lib2to3.fixes.fix_imports import MAPPING as modules
def test_multiple_imports(self):
b = """import urlparse, cStringIO"""
@@ -1812,16 +1812,16 @@ class Test_imports(FixerTestCase, ImportsFixerTests):
class Test_imports2(FixerTestCase, ImportsFixerTests):
fixer = "imports2"
- from ..fixes.fix_imports2 import MAPPING as modules
+ from lib2to3.fixes.fix_imports2 import MAPPING as modules
class Test_imports_fixer_order(FixerTestCase, ImportsFixerTests):
def setUp(self):
super(Test_imports_fixer_order, self).setUp(['imports', 'imports2'])
- from ..fixes.fix_imports2 import MAPPING as mapping2
+ from lib2to3.fixes.fix_imports2 import MAPPING as mapping2
self.modules = mapping2.copy()
- from ..fixes.fix_imports import MAPPING as mapping1
+ from lib2to3.fixes.fix_imports import MAPPING as mapping1
for key in ('dbhash', 'dumbdbm', 'dbm', 'gdbm'):
self.modules[key] = mapping1[key]
@@ -1833,7 +1833,7 @@ class Test_imports_fixer_order(FixerTestCase, ImportsFixerTests):
class Test_urllib(FixerTestCase):
fixer = "urllib"
- from ..fixes.fix_urllib import MAPPING as modules
+ from lib2to3.fixes.fix_urllib import MAPPING as modules
def test_import_module(self):
for old, changes in self.modules.items():
diff --git a/Lib/lib2to3/tests/test_main.py b/Lib/test/test_lib2to3/test_main.py
index a33c45c..a33c45c 100644
--- a/Lib/lib2to3/tests/test_main.py
+++ b/Lib/test/test_lib2to3/test_main.py
diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/test/test_lib2to3/test_parser.py
index 8e7773b..2c798b1 100644
--- a/Lib/lib2to3/tests/test_parser.py
+++ b/Lib/test/test_lib2to3/test_parser.py
@@ -26,7 +26,7 @@ import unittest
# Local imports
from lib2to3.pgen2 import driver as pgen2_driver
from lib2to3.pgen2 import tokenize
-from ..pgen2.parse import ParseError
+from lib2to3.pgen2.parse import ParseError
from lib2to3.pygram import python_symbols as syms
diff --git a/Lib/lib2to3/tests/test_pytree.py b/Lib/test/test_lib2to3/test_pytree.py
index 177126d..177126d 100644
--- a/Lib/lib2to3/tests/test_pytree.py
+++ b/Lib/test/test_lib2to3/test_pytree.py
diff --git a/Lib/lib2to3/tests/test_refactor.py b/Lib/test/test_lib2to3/test_refactor.py
index be70567..be70567 100644
--- a/Lib/lib2to3/tests/test_refactor.py
+++ b/Lib/test/test_lib2to3/test_refactor.py
diff --git a/Lib/lib2to3/tests/test_util.py b/Lib/test/test_lib2to3/test_util.py
index c6c6139..c6c6139 100644
--- a/Lib/lib2to3/tests/test_util.py
+++ b/Lib/test/test_lib2to3/test_util.py