Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update includes
  • Loading branch information
vstinner committed Jun 21, 2022
commit fe2f82a7ef9a6aecee3dc1e220bf75d289cb2d0e
6 changes: 3 additions & 3 deletions Lib/test/test_lib2to3/pytree_idempotency.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
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()

Expand Down
4 changes: 3 additions & 1 deletion Lib/test/test_lib2to3/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
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"]
Expand Down
12 changes: 6 additions & 6 deletions Lib/test/test_lib2to3/test_fixers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Local imports
from lib2to3 import pygram, fixer_util
from lib2to3.tests import support
from test.test_lib2to3 import support


class FixerTestCase(support.TestCase):
Expand Down Expand Up @@ -1791,7 +1791,7 @@ def f():

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"""
Expand All @@ -1812,16 +1812,16 @@ def test_multiple_imports_as(self):

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]

Expand All @@ -1833,7 +1833,7 @@ def test_after_local_imports_refactoring(self):

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():
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_lib2to3/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# 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


Expand Down