mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-08 05:34:51 +08:00
Move more tests.
This commit is contained in:
@@ -120,6 +120,7 @@ FAILING_EXAMPLES = [
|
|||||||
r'b"\"',
|
r'b"\"',
|
||||||
'*a, *b = 3, 3',
|
'*a, *b = 3, 3',
|
||||||
'async def foo(): yield from []',
|
'async def foo(): yield from []',
|
||||||
|
'yield from []',
|
||||||
|
|
||||||
# Parser/tokenize.c
|
# Parser/tokenize.c
|
||||||
r'"""',
|
r'"""',
|
||||||
@@ -244,7 +245,10 @@ if sys.version_info >= (3, 6):
|
|||||||
FAILING_EXAMPLES += GLOBAL_NONLOCAL_ERROR
|
FAILING_EXAMPLES += GLOBAL_NONLOCAL_ERROR
|
||||||
FAILING_EXAMPLES.append('(%s *d) = x' % ('a,' * 256))
|
FAILING_EXAMPLES.append('(%s *d) = x' % ('a,' * 256))
|
||||||
if sys.version_info >= (3, 5):
|
if sys.version_info >= (3, 5):
|
||||||
FAILING_EXAMPLES.append('[*[] for a in [1]]')
|
FAILING_EXAMPLES += [
|
||||||
|
'[*[] for a in [1]]',
|
||||||
|
'async def bla():\n def x(): await bla()',
|
||||||
|
]
|
||||||
if sys.version_info >= (3, 4):
|
if sys.version_info >= (3, 4):
|
||||||
# Before that del None works like del list, it gives a NameError.
|
# Before that del None works like del list, it gives a NameError.
|
||||||
FAILING_EXAMPLES.append('del None')
|
FAILING_EXAMPLES.append('del None')
|
||||||
@@ -266,6 +270,8 @@ if sys.version_info >= (2, 7):
|
|||||||
FAILING_EXAMPLES.append('[a, 1] += 3')
|
FAILING_EXAMPLES.append('[a, 1] += 3')
|
||||||
|
|
||||||
if sys.version_info[:2] == (3, 5):
|
if sys.version_info[:2] == (3, 5):
|
||||||
|
# yields are not allowed in 3.5 async functions. Therefore test them
|
||||||
|
# separately, here.
|
||||||
FAILING_EXAMPLES += [
|
FAILING_EXAMPLES += [
|
||||||
'async def foo():\n yield x',
|
'async def foo():\n yield x',
|
||||||
'async def foo():\n yield x',
|
'async def foo():\n yield x',
|
||||||
@@ -387,9 +393,6 @@ def test_default_except_error_postition():
|
|||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
('code', 'version'), [
|
('code', 'version'), [
|
||||||
# SyntaxError
|
|
||||||
('async def bla():\n def x(): await bla()', '3.5'),
|
|
||||||
('yield from []', '3.5'),
|
|
||||||
('*a = 3', '3.5'),
|
('*a = 3', '3.5'),
|
||||||
('del *a, b', '3.5'),
|
('del *a, b', '3.5'),
|
||||||
('def x(*): pass', '3.5'),
|
('def x(*): pass', '3.5'),
|
||||||
|
|||||||
Reference in New Issue
Block a user