root@tassadar:~/parso# pytest
========================================================= test session starts ==========================================================
platform linux -- Python 3.8.0a2, pytest-4.3.1, py-1.8.0, pluggy-0.9.0
rootdir: /root/parso, inifile: pytest.ini
collected 937 items
parso/__init__.py . [ 0%]
parso/python/tree.py . [ 0%]
test/test_absolute_import.py ... [ 0%]
test/test_cache.py .. [ 0%]
test/test_diff_parser.py ............................................................ [ 7%]
test/test_error_recovery.py ............ [ 8%]
test/test_file_python_errors.py ....... [ 9%]
test/test_fstring.py ................................. [ 12%]
test/test_get_code.py ...... [ 13%]
test/test_grammar.py . [ 13%]
test/test_load_grammar.py ............ [ 14%]
test/test_normalizer_issues_files.py .................................. [ 18%]
test/test_old_fast_parser.py ............... [ 19%]
test/test_param_splitting.py ......... [ 20%]
test/test_parser.py ............................................................................................................ [ 32%]
............. [ 33%]
test/test_parser_tree.py ................................................... [ 39%]
test/test_pep8.py ... [ 39%]
test/test_pgen2.py .......................x..................................................................................... [ 51%]
................................................................................................................................ [ 64%]
................................................. [ 70%]
test/test_prefix.py ..................... [ 72%]
test/test_python_errors.py ..F....F......FF..........FF........FFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFF................F............. [ 83%]
..................................FF.FFF.......F................................................ [ 93%]
test/test_tokenize.py ........................................ [ 97%]
test/test_utils.py ...................... [100%]
=============================================================== FAILURES ===============================================================
________________ test_python_exception_matches[for a in [1]:\n try:\n pass\n finally:\n continue\n] ________________
code = 'for a in [1]:\n try:\n pass\n finally:\n continue\n'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
> wanted, line_nr = _get_actual_exception(code)
test/test_python_errors.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
code = 'for a in [1]:\n try:\n pass\n finally:\n continue\n'
def _get_actual_exception(code):
with warnings.catch_warnings():
# We don't care about warnings where locals/globals misbehave here.
# It's as simple as either an error or not.
warnings.filterwarnings('ignore', category=SyntaxWarning)
try:
compile(code, '<unknown>', 'exec')
except (SyntaxError, IndentationError) as e:
wanted = e.__class__.__name__ + ': ' + e.msg
line_nr = e.lineno
except ValueError as e:
# The ValueError comes from byte literals in Python 2 like '\x'
# that are oddly enough not SyntaxErrors.
wanted = 'SyntaxError: (value error) ' + str(e)
line_nr = None
else:
> assert False, "The piece of code should raise an exception."
E AssertionError: The piece of code should raise an exception.
E assert False
test/test_python_errors.py:95: AssertionError
_________________________________________ test_python_exception_matches[f(x for x in bar, 1)] __________________________________________
code = 'f(x for x in bar, 1)'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert 'SyntaxError: positional argument follows keyword argument' in ['SyntaxError: Generator expression must be parenthesized']
test/test_python_errors.py:39: AssertionError
_____________________________________________ test_python_exception_matches[__debug__ = 1] _____________________________________________
code = '__debug__ = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert 'SyntaxError: assignment to keyword' in ['SyntaxError: cannot assign to __debug__']
test/test_python_errors.py:39: AssertionError
______________________________________ test_python_exception_matches[with x() as __debug__: pass] ______________________________________
code = 'with x() as __debug__: pass'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert 'SyntaxError: assignment to keyword' in ['SyntaxError: cannot assign to __debug__']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[foo(+a=3)] _______________________________________________
code = 'foo(+a=3)'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: keyword can't be an expression" in ['SyntaxError: expression cannot contain assignment, perhaps you meant "=="?']
test/test_python_errors.py:39: AssertionError
____________________________________________ test_python_exception_matches[f(lambda: 1=1)] _____________________________________________
code = 'f(lambda: 1=1)'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert 'SyntaxError: lambda cannot contain assignment' in ['SyntaxError: expression cannot contain assignment, perhaps you meant "=="?']
test/test_python_errors.py:39: AssertionError
____________________________________________ test_python_exception_matches[lambda a: 1 = 1] ____________________________________________
code = 'lambda a: 1 = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to lambda" in ['SyntaxError: cannot assign to lambda']
test/test_python_errors.py:39: AssertionError
__________________________________________ test_python_exception_matches[[x for x in y] = 1] ___________________________________________
code = '[x for x in y] = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: cannot assign to list comprehension']
test/test_python_errors.py:39: AssertionError
__________________________________________ test_python_exception_matches[{x for x in y} = 1] ___________________________________________
code = '{x for x in y} = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to set comprehension']
test/test_python_errors.py:39: AssertionError
_________________________________________ test_python_exception_matches[{x:x for x in y} = 1] __________________________________________
code = '{x:x for x in y} = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to dict comprehension']
test/test_python_errors.py:39: AssertionError
__________________________________________ test_python_exception_matches[(x for x in y) = 1] ___________________________________________
code = '(x for x in y) = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: cannot assign to generator expression']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[None = 1] ________________________________________________
code = 'None = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to keyword" in ['SyntaxError: cannot assign to None']
test/test_python_errors.py:39: AssertionError
________________________________________________ test_python_exception_matches[... = 1] ________________________________________________
code = '... = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to Ellipsis" in ['SyntaxError: cannot assign to Ellipsis']
test/test_python_errors.py:39: AssertionError
______________________________________________ test_python_exception_matches[a == b = 1] _______________________________________________
code = 'a == b = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to comparison" in ['SyntaxError: cannot assign to comparison']
test/test_python_errors.py:39: AssertionError
______________________________________________ test_python_exception_matches[{a, b} = 1] _______________________________________________
code = '{a, b} = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to set display']
test/test_python_errors.py:39: AssertionError
______________________________________________ test_python_exception_matches[{a: b} = 1] _______________________________________________
code = '{a: b} = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to dict display']
test/test_python_errors.py:39: AssertionError
_________________________________________________ test_python_exception_matches[1 = 1] _________________________________________________
code = '1 = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
________________________________________________ test_python_exception_matches["" = 1] _________________________________________________
code = '"" = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[b"" = 10] ________________________________________________
code = 'b"" = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[b"" = 11] ________________________________________________
code = 'b"" = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches["" "" = 1] _______________________________________________
code = '"" "" = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[1 | 1 = 3] _______________________________________________
code = '1 | 1 = 3'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to operator" in ['SyntaxError: cannot assign to operator']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[1**1 = 3] ________________________________________________
code = '1**1 = 3'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to operator" in ['SyntaxError: cannot assign to operator']
test/test_python_errors.py:39: AssertionError
________________________________________________ test_python_exception_matches[~ 1 = 3] ________________________________________________
code = '~ 1 = 3'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to operator" in ['SyntaxError: cannot assign to operator']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[not 1 = 3] _______________________________________________
code = 'not 1 = 3'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to operator" in ['SyntaxError: cannot assign to operator']
test/test_python_errors.py:39: AssertionError
______________________________________________ test_python_exception_matches[1 and 1 = 3] ______________________________________________
code = '1 and 1 = 3'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to operator" in ['SyntaxError: cannot assign to operator']
test/test_python_errors.py:39: AssertionError
_______________________________________ test_python_exception_matches[def foo(): (yield 1) = 3] ________________________________________
code = 'def foo(): (yield 1) = 3'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to yield expression" in ['SyntaxError: cannot assign to yield expression']
test/test_python_errors.py:39: AssertionError
_____________________________________ test_python_exception_matches[async def foo(): await x = 3] ______________________________________
code = 'async def foo(): await x = 3'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to await expression" in ['SyntaxError: cannot assign to await expression']
test/test_python_errors.py:39: AssertionError
__________________________________________ test_python_exception_matches[(a if a else a) = a] __________________________________________
code = '(a if a else a) = a'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to conditional expression" in ['SyntaxError: cannot assign to conditional expression']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[a, 1 = x] ________________________________________________
code = 'a, 1 = x'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[foo() = 1] _______________________________________________
code = 'foo() = 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to function call" in ['SyntaxError: cannot assign to function call']
test/test_python_errors.py:39: AssertionError
_________________________________________ test_python_exception_matches[with x as foo(): pass] _________________________________________
code = 'with x as foo(): pass'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to function call" in ['SyntaxError: cannot assign to function call']
test/test_python_errors.py:39: AssertionError
______________________________________________ test_python_exception_matches[del bar, 1] _______________________________________________
code = 'del bar, 1'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't delete literal" in ['SyntaxError: cannot delete literal']
test/test_python_errors.py:39: AssertionError
_________________________________________ test_python_exception_matches[for x, 1 in []: pass] __________________________________________
code = 'for x, 1 in []: pass'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
________________________________________ test_python_exception_matches[for (not 1) in []: pass] ________________________________________
code = 'for (not 1) in []: pass'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to operator" in ['SyntaxError: cannot assign to operator']
test/test_python_errors.py:39: AssertionError
____________________________________________ test_python_exception_matches[[x for 1 in y]] _____________________________________________
code = '[x for 1 in y]'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
___________________________________________ test_python_exception_matches[[x for a, 3 in y]] ___________________________________________
code = '[x for a, 3 in y]'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
____________________________________________ test_python_exception_matches[(x for 1 in y)] _____________________________________________
code = '(x for 1 in y)'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
____________________________________________ test_python_exception_matches[{x for 1 in y}] _____________________________________________
code = '{x for 1 in y}'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
___________________________________________ test_python_exception_matches[{x:x for 1 in y}] ____________________________________________
code = '{x:x for 1 in y}'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
__________________________________________ test_python_exception_matches[{**{} for a in [1]}] __________________________________________
code = '{**{} for a in [1]}'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: dict unpacking cannot be used in dict comprehension']
test/test_python_errors.py:39: AssertionError
_________________________ test_python_exception_matches[async def foo():\n def nofoo():[x async for x in []]] __________________________
code = 'async def foo():\n def nofoo():[x async for x in []]'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
> errors = _get_error_list(code)
test/test_python_errors.py:34:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test_python_errors.py:22: in _get_error_list
return list(grammar.iter_errors(tree))
parso/grammar.py:165: in iter_errors
return self._get_normalizer_issues(node, self._error_normalizer_config)
parso/grammar.py:185: in _get_normalizer_issues
normalizer.walk(node)
parso/normalizer.py:34: in walk
value = self.visit(node)
parso/python/errors.py:280: in visit
return super(ErrorFinder, self).visit(node)
parso/normalizer.py:45: in visit
return ''.join(self.visit(child) for child in children)
parso/normalizer.py:45: in <genexpr>
return ''.join(self.visit(child) for child in children)
parso/python/errors.py:280: in visit
return super(ErrorFinder, self).visit(node)
parso/normalizer.py:45: in visit
return ''.join(self.visit(child) for child in children)
parso/normalizer.py:45: in <genexpr>
return ''.join(self.visit(child) for child in children)
parso/python/errors.py:280: in visit
return super(ErrorFinder, self).visit(node)
parso/normalizer.py:45: in visit
return ''.join(self.visit(child) for child in children)
parso/normalizer.py:45: in <genexpr>
return ''.join(self.visit(child) for child in children)
parso/python/errors.py:280: in visit
return super(ErrorFinder, self).visit(node)
parso/normalizer.py:45: in visit
return ''.join(self.visit(child) for child in children)
parso/normalizer.py:45: in <genexpr>
return ''.join(self.visit(child) for child in children)
parso/python/errors.py:280: in visit
return super(ErrorFinder, self).visit(node)
parso/normalizer.py:45: in visit
return ''.join(self.visit(child) for child in children)
parso/normalizer.py:45: in <genexpr>
return ''.join(self.visit(child) for child in children)
parso/python/errors.py:280: in visit
return super(ErrorFinder, self).visit(node)
parso/normalizer.py:45: in visit
return ''.join(self.visit(child) for child in children)
parso/normalizer.py:45: in <genexpr>
return ''.join(self.visit(child) for child in children)
parso/python/errors.py:280: in visit
return super(ErrorFinder, self).visit(node)
parso/normalizer.py:45: in visit
return ''.join(self.visit(child) for child in children)
parso/normalizer.py:45: in <genexpr>
return ''.join(self.visit(child) for child in children)
parso/python/errors.py:280: in visit
return super(ErrorFinder, self).visit(node)
parso/normalizer.py:44: in visit
with self.visit_node(node):
/usr/local/lib/python3.8/contextlib.py:113: in __enter__
return next(self.gen)
parso/python/errors.py:285: in visit_node
self._check_type_rules(node)
parso/normalizer.py:54: in _check_type_rules
rule.feed_node(node)
parso/normalizer.py:182: in feed_node
if self.is_issue(node):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <parso.python.errors._CompForRule object at 0x7f2dfe14cb50>, node = <CompFor: async for x in []@2,16>
def is_issue(self, node):
# Some of the nodes here are already used, so no else if
> expr_list = node.children[1 + int(node.children[0] == 'async')]
E IndexError: list index out of range
parso/python/errors.py:948: IndexError
__________________________________________ test_python_exception_matches[[*[] for a in [1]]] ___________________________________________
code = '[*[] for a in [1]]'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E AssertionError: assert None in ['SyntaxError: iterable unpacking cannot be used in comprehension']
test/test_python_errors.py:39: AssertionError
_______________________________________________ test_python_exception_matches[del None] ________________________________________________
code = 'del None'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't delete keyword" in ['SyntaxError: cannot delete None']
test/test_python_errors.py:39: AssertionError
______________________________________________ test_python_exception_matches[(True,) = x] ______________________________________________
code = '(True,) = x'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to keyword" in ['SyntaxError: cannot assign to True']
test/test_python_errors.py:39: AssertionError
___________________________________________ test_python_exception_matches[([False], a) = x] ____________________________________________
code = '([False], a) = x'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to keyword" in ['SyntaxError: cannot assign to False']
test/test_python_errors.py:39: AssertionError
______________________________________________ test_python_exception_matches[[a, 1] += 3] ______________________________________________
code = '[a, 1] += 3'
@pytest.mark.parametrize('code', FAILING_EXAMPLES)
def test_python_exception_matches(code):
wanted, line_nr = _get_actual_exception(code)
errors = _get_error_list(code)
actual = None
if errors:
error, = errors
actual = error.message
> assert actual in wanted
E assert "SyntaxError: can't assign to literal" in ['SyntaxError: cannot assign to literal']
test/test_python_errors.py:39: AssertionError
========================================== 47 failed, 889 passed, 1 xfailed in 11.89 seconds ===========================================