mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-21446: Update reload fixer to use importlib (GH-8391)
This commit is contained in:
parent
d04f46c59f
commit
7a3056fa7d
4 changed files with 12 additions and 10 deletions
|
|
@ -290,30 +290,30 @@ class Test_reload(FixerTestCase):
|
|||
|
||||
def test(self):
|
||||
b = """reload(a)"""
|
||||
a = """import imp\nimp.reload(a)"""
|
||||
a = """import importlib\nimportlib.reload(a)"""
|
||||
self.check(b, a)
|
||||
|
||||
def test_comment(self):
|
||||
b = """reload( a ) # comment"""
|
||||
a = """import imp\nimp.reload( a ) # comment"""
|
||||
a = """import importlib\nimportlib.reload( a ) # comment"""
|
||||
self.check(b, a)
|
||||
|
||||
# PEP 8 comments
|
||||
b = """reload( a ) # comment"""
|
||||
a = """import imp\nimp.reload( a ) # comment"""
|
||||
a = """import importlib\nimportlib.reload( a ) # comment"""
|
||||
self.check(b, a)
|
||||
|
||||
def test_space(self):
|
||||
b = """reload( a )"""
|
||||
a = """import imp\nimp.reload( a )"""
|
||||
a = """import importlib\nimportlib.reload( a )"""
|
||||
self.check(b, a)
|
||||
|
||||
b = """reload( a)"""
|
||||
a = """import imp\nimp.reload( a)"""
|
||||
a = """import importlib\nimportlib.reload( a)"""
|
||||
self.check(b, a)
|
||||
|
||||
b = """reload(a )"""
|
||||
a = """import imp\nimp.reload(a )"""
|
||||
a = """import importlib\nimportlib.reload(a )"""
|
||||
self.check(b, a)
|
||||
|
||||
def test_unchanged(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue