1. Joe Amenta
  2. lib3to2


Shawn Brown  committed 07725dd

Fixing imports for dependencies from lib2to3/test. Inserting development repo path into sys.path when running test_all_fixers.py as __main__.

  • Participants
  • Parent commits b5fab8c
  • Branches default

Comments (0)

Files changed (2)

File lib3to2/tests/lib2to3_fixertestcase.py

View file
  • Ignore whitespace
 """ FixerTestCase from lib2to3/tests/test_fixers.py """
+from itertools import chain
+import lib2to3_support as support
 class FixerTestCase(support.TestCase):
     # Other test cases can subclass this class and replace "fixer_pkg" with

File lib3to2/tests/test_all_fixers.py

View file
  • Ignore whitespace
 import os
 from lib2to3 import pygram
-from lib2to3.tests import support
-from lib2to3.tests.test_fixers import FixerTestCase
+import lib2to3_support as support
+from lib2to3_fixertestcase import FixerTestCase
 class lib3to2FixerTestCase(FixerTestCase):
     def setUp(self, fix_list=None, fixer_pkg="lib3to2"):
         super(lib3to2FixerTestCase, self).setUp(fixer_pkg=fixer_pkg)
         self.refactor.driver.grammar = pygram.python_grammar_no_print_statement
 if __name__ == "__main__":
-    for module in os.listdir(os.path.split(__file__)[0]):
+    import sys
+    repo_path = os.path.join(os.path.dirname(__file__), '../../')
+    sys.path.insert(0, repo_path)
+    for module in os.listdir(os.path.dirname(os.path.abspath(__file__))):
         if module.endswith('.py') and module.startswith('test_'):
             module = os.path.split(module)[1][:-3]
             if module != os.path.split(__file__)[1][:-3]: