mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
SF patch #1007189, multi-line imports, for instance:
"from blah import (foo, bar baz, bongo)"
This commit is contained in:
parent
876032e570
commit
1a4ddaecc7
14 changed files with 1394 additions and 1181 deletions
|
@ -130,12 +130,26 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
|
|||
def test_import_from_statement(self):
|
||||
self.check_suite("from sys.path import *")
|
||||
self.check_suite("from sys.path import dirname")
|
||||
self.check_suite("from sys.path import (dirname)")
|
||||
self.check_suite("from sys.path import (dirname,)")
|
||||
self.check_suite("from sys.path import dirname as my_dirname")
|
||||
self.check_suite("from sys.path import (dirname as my_dirname)")
|
||||
self.check_suite("from sys.path import (dirname as my_dirname,)")
|
||||
self.check_suite("from sys.path import dirname, basename")
|
||||
self.check_suite("from sys.path import (dirname, basename)")
|
||||
self.check_suite("from sys.path import (dirname, basename,)")
|
||||
self.check_suite(
|
||||
"from sys.path import dirname as my_dirname, basename")
|
||||
self.check_suite(
|
||||
"from sys.path import (dirname as my_dirname, basename)")
|
||||
self.check_suite(
|
||||
"from sys.path import (dirname as my_dirname, basename,)")
|
||||
self.check_suite(
|
||||
"from sys.path import dirname, basename as my_basename")
|
||||
self.check_suite(
|
||||
"from sys.path import (dirname, basename as my_basename)")
|
||||
self.check_suite(
|
||||
"from sys.path import (dirname, basename as my_basename,)")
|
||||
|
||||
def test_basic_import_statement(self):
|
||||
self.check_suite("import sys")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue