mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
Issue #9130: Validate ellipsis tokens in relative imports.
This commit is contained in:
parent
3445b482b3
commit
feb3b75818
2 changed files with 12 additions and 6 deletions
|
@ -192,8 +192,14 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
|
|||
def test_relative_imports(self):
|
||||
self.check_suite("from . import name")
|
||||
self.check_suite("from .. import name")
|
||||
# check all the way up to '....', since '...' is tokenized
|
||||
# differently from '.' (it's an ellipsis token).
|
||||
self.check_suite("from ... import name")
|
||||
self.check_suite("from .... import name")
|
||||
self.check_suite("from .pkg import name")
|
||||
self.check_suite("from ..pkg import name")
|
||||
self.check_suite("from ...pkg import name")
|
||||
self.check_suite("from ....pkg import name")
|
||||
|
||||
def test_pep263(self):
|
||||
self.check_suite("# -*- coding: iso-8859-1 -*-\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue