SF patch #1007189, multi-line imports, for instance:

"from blah import (foo, bar
baz, bongo)"
This commit is contained in:
Anthony Baxter 2004-08-31 10:07:13 +00:00
parent 876032e570
commit 1a4ddaecc7
14 changed files with 1394 additions and 1181 deletions

View file

@ -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")