Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Astroid 2.2 and Python 3.8 test failures #28

Closed
hroncok opened this issue Apr 8, 2019 · 13 comments
Closed

Astroid 2.2 and Python 3.8 test failures #28

hroncok opened this issue Apr 8, 2019 · 13 comments

Comments

@hroncok
Copy link

hroncok commented Apr 8, 2019

The test suite fails with Python 3.8.0a3:

On c8697dc with:

diff --git a/tox.ini b/tox.ini
index b320505..30652a5 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,7 @@
 # and then run "tox" from this directory.
 
 [tox]
-envlist = py{27,35,36,37}
+envlist = py{27,35,36,37,38}
 
 [testenv]
 commands = nosetests
@@ -13,4 +13,4 @@ deps =
     coverage
     py{27}: astroid
     py{35,36}: astroid<2
-    py{37}: astroid>=2.dev
+    py{37,38}: astroid>=2.dev
$ tox -e py38
GLOB sdist-make: .../asttokens/setup.py
py38 inst-nodeps: .../asttokens/.tox/.tmp/package/1/asttokens-1.1.13.zip
py38 installed: astroid==2.2.5,asttokens==1.1.13,coverage==4.5.3,lazy-object-proxy==1.3.1,nose==1.3.7,six==1.12.0,typed-ast==1.3.1,wrapt==1.11.1
py38 run-test-pre: PYTHONHASHSEED='707348335'
py38 runtests: commands[0] | nosetests
..E...S..E.FF..F.FEEE....E.EEE.....F.......FEEFFFF.E........EEE.FFEE.EEEF....F.
======================================================================
ERROR: test_calling_lambdas (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 353, in test_calling_lambdas
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 385, in visit_call
    newnode.postinit(self.visit(node.func, newnode), args, keywords)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 699, in visit_lambda
    newnode.postinit(self.visit(node.args, newnode), self.visit(node.body, newnode))
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_fixture10 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 147, in test_fixture10
    def test_fixture10(self): self.verify_fixture_file('astroid/noendingnewline.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 652, in visit_if
    self.visit(node.test, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 438, in visit_compare
    [
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 439, in <listcomp>
    (self._cmp_op_classes[op.__class__], self.visit(expr, newnode))
KeyError: <class '_ast.Eq'>

======================================================================
ERROR: test_fixture7 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 144, in test_fixture7
    def test_fixture7(self): self.verify_fixture_file('astroid/format.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 716, in visit_listcomp
    [self.visit(child, newnode) for child in node.generators],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 716, in <listcomp>
    [self.visit(child, newnode) for child in node.generators],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 451, in visit_comprehension
    [self.visit(child, newnode) for child in node.ifs],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 451, in <listcomp>
    [self.visit(child, newnode) for child in node.ifs],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Mod'>

======================================================================
ERROR: test_fixture8 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 145, in test_fixture8
    def test_fixture8(self): self.verify_fixture_file('astroid/module.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 1031, in visit_classdef
    return super(TreeRebuilder3, self).visit_classdef(
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 404, in visit_classdef
    [self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 404, in <listcomp>
    [self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 607, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in _visit_functiondef
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 982, in visit_try
    body = [self.visit(child, newnode) for child in node.body]
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 982, in <listcomp>
    body = [self.visit(child, newnode) for child in node.body]
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 652, in visit_if
    self.visit(node.test, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 438, in visit_compare
    [
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 439, in <listcomp>
    (self._cmp_op_classes[op.__class__], self.visit(expr, newnode))
KeyError: <class '_ast.In'>

======================================================================
ERROR: test_fixture9 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 146, in test_fixture9
    def test_fixture9(self): self.verify_fixture_file('astroid/module2.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.BitOr'>

======================================================================
ERROR: test_nonascii (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 264, in test_nonascii
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_parens_around_func (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 515, in test_parens_around_func
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 385, in visit_call
    newnode.postinit(self.visit(node.func, newnode), args, keywords)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 342, in visit_boolop
    self._bool_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Or'>

======================================================================
ERROR: test_print_function (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 250, in test_print_function
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 986, in visit_try
    return self.visit_tryexcept(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 847, in visit_tryexcept
    [self.visit(child, newnode) for child in node.handlers],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 847, in <listcomp>
    [self.visit(child, newnode) for child in node.handlers],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 942, in visit_excepthandler
    [self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 942, in <listcomp>
    [self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 607, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in _visit_functiondef
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 560, in visit_for
    return self._visit_for(nodes.For, node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 553, in _visit_for
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 553, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 313, in visit_augassign
    self._bin_op_classes[type(node.op)] + "=",
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_return_annotation (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 403, in test_return_annotation
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 607, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in _visit_functiondef
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 803, in visit_return
    newnode.postinit(self.visit(node.value, newnode))
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_calling_lambdas (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 353, in test_calling_lambdas
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 385, in visit_call
    newnode.postinit(self.visit(node.func, newnode), args, keywords)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 699, in visit_lambda
    newnode.postinit(self.visit(node.args, newnode), self.visit(node.body, newnode))
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_comprehensions (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 369, in test_comprehensions
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_mark_tokens.py", line 21, in create_mark_checker
    return tools.MarkChecker(source, parse=True)
  File ".../asttokens/tests/tools.py", line 82, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 65, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 76, in mark_tokens
    MarkTokens(self).visit_tree(root_node)
  File ".../asttokens/asttokens/mark_tokens.py", line 47, in visit_tree
    util.visit_tree(node, self._visit_before_children, self._visit_after_children)
  File ".../asttokens/asttokens/util.py", line 184, in visit_tree
    ret = postvisit(current, par_value, value)
  File ".../asttokens/asttokens/mark_tokens.py", line 90, in _visit_after_children
    nfirst, nlast = self._methods.get(self, node.__class__)(node, first, last)
  File ".../asttokens/asttokens/mark_tokens.py", line 175, in visit_listcomp
    return self.handle_comp('[', node, first_token, last_token)
  File ".../asttokens/asttokens/mark_tokens.py", line 171, in handle_comp
    util.expect_token(before, token.OP, open_brace)
  File ".../asttokens/asttokens/util.py", line 56, in expect_token
    raise ValueError("Expected token %s, got %s on line %s col %s" % (
ValueError: Expected token OP:'[', got ENDMARKER:'' on line 2 col 1

======================================================================
ERROR: test_fixture10 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 147, in test_fixture10
    def test_fixture10(self): self.verify_fixture_file('astroid/noendingnewline.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 652, in visit_if
    self.visit(node.test, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 438, in visit_compare
    [
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 439, in <listcomp>
    (self._cmp_op_classes[op.__class__], self.visit(expr, newnode))
KeyError: <class '_ast.Eq'>

======================================================================
ERROR: test_fixture7 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 144, in test_fixture7
    def test_fixture7(self): self.verify_fixture_file('astroid/format.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_mark_tokens.py", line 21, in create_mark_checker
    return tools.MarkChecker(source, parse=True)
  File ".../asttokens/tests/tools.py", line 82, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 65, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 76, in mark_tokens
    MarkTokens(self).visit_tree(root_node)
  File ".../asttokens/asttokens/mark_tokens.py", line 47, in visit_tree
    util.visit_tree(node, self._visit_before_children, self._visit_after_children)
  File ".../asttokens/asttokens/util.py", line 184, in visit_tree
    ret = postvisit(current, par_value, value)
  File ".../asttokens/asttokens/mark_tokens.py", line 90, in _visit_after_children
    nfirst, nlast = self._methods.get(self, node.__class__)(node, first, last)
  File ".../asttokens/asttokens/mark_tokens.py", line 175, in visit_listcomp
    return self.handle_comp('[', node, first_token, last_token)
  File ".../asttokens/asttokens/mark_tokens.py", line 171, in handle_comp
    util.expect_token(before, token.OP, open_brace)
  File ".../asttokens/asttokens/util.py", line 56, in expect_token
    raise ValueError("Expected token %s, got %s on line %s col %s" % (
ValueError: Expected token OP:'[', got OP:'=' on line 7 col 3

======================================================================
ERROR: test_fixture8 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 145, in test_fixture8
    def test_fixture8(self): self.verify_fixture_file('astroid/module.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_mark_tokens.py", line 21, in create_mark_checker
    return tools.MarkChecker(source, parse=True)
  File ".../asttokens/tests/tools.py", line 82, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 65, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 76, in mark_tokens
    MarkTokens(self).visit_tree(root_node)
  File ".../asttokens/asttokens/mark_tokens.py", line 47, in visit_tree
    util.visit_tree(node, self._visit_before_children, self._visit_after_children)
  File ".../asttokens/asttokens/util.py", line 184, in visit_tree
    ret = postvisit(current, par_value, value)
  File ".../asttokens/asttokens/mark_tokens.py", line 90, in _visit_after_children
    nfirst, nlast = self._methods.get(self, node.__class__)(node, first, last)
  File ".../asttokens/asttokens/mark_tokens.py", line 175, in visit_listcomp
    return self.handle_comp('[', node, first_token, last_token)
  File ".../asttokens/asttokens/mark_tokens.py", line 171, in handle_comp
    util.expect_token(before, token.OP, open_brace)
  File ".../asttokens/asttokens/util.py", line 56, in expect_token
    raise ValueError("Expected token %s, got %s on line %s col %s" % (
ValueError: Expected token OP:'[', got OP:'=' on line 53 col 19

======================================================================
ERROR: test_fixture9 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 146, in test_fixture9
    def test_fixture9(self): self.verify_fixture_file('astroid/module2.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.BitOr'>

======================================================================
ERROR: test_mark_tokens_simple (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 47, in test_mark_tokens_simple
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_mark_tokens.py", line 21, in create_mark_checker
    return tools.MarkChecker(source, parse=True)
  File ".../asttokens/tests/tools.py", line 82, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 65, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 76, in mark_tokens
    MarkTokens(self).visit_tree(root_node)
  File ".../asttokens/asttokens/mark_tokens.py", line 47, in visit_tree
    util.visit_tree(node, self._visit_before_children, self._visit_after_children)
  File ".../asttokens/asttokens/util.py", line 184, in visit_tree
    ret = postvisit(current, par_value, value)
  File ".../asttokens/asttokens/mark_tokens.py", line 90, in _visit_after_children
    nfirst, nlast = self._methods.get(self, node.__class__)(node, first, last)
  File ".../asttokens/asttokens/mark_tokens.py", line 175, in visit_listcomp
    return self.handle_comp('[', node, first_token, last_token)
  File ".../asttokens/asttokens/mark_tokens.py", line 171, in handle_comp
    util.expect_token(before, token.OP, open_brace)
  File ".../asttokens/asttokens/util.py", line 56, in expect_token
    raise ValueError("Expected token %s, got %s on line %s col %s" % (
ValueError: Expected token OP:'[', got OP:'=' on line 53 col 19

======================================================================
ERROR: test_nonascii (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 264, in test_nonascii
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_parens_around_func (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 515, in test_parens_around_func
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 294, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 385, in visit_call
    newnode.postinit(self.visit(node.func, newnode), args, keywords)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 342, in visit_boolop
    self._bool_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Or'>

======================================================================
ERROR: test_print_function (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 250, in test_print_function
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 986, in visit_try
    return self.visit_tryexcept(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 847, in visit_tryexcept
    [self.visit(child, newnode) for child in node.handlers],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 847, in <listcomp>
    [self.visit(child, newnode) for child in node.handlers],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 942, in visit_excepthandler
    [self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 942, in <listcomp>
    [self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 607, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in _visit_functiondef
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 560, in visit_for
    return self._visit_for(nodes.For, node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 553, in _visit_for
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 553, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 313, in visit_augassign
    self._bin_op_classes[type(node.op)] + "=",
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_return_annotation (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 403, in test_return_annotation
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    left = to_source(rebuilt_node)
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 158, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 607, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in _visit_functiondef
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 597, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 803, in visit_return
    newnode.postinit(self.visit(node.value, newnode))
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 170, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py38/lib/python3.8/site-packages/astroid/rebuilder.py", line 332, in visit_binop
    self._bin_op_classes[type(node.op)], node.lineno, node.col_offset, parent
KeyError: <class '_ast.Add'>

======================================================================
FAIL: test_fixture12 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 149, in test_fixture12
    def test_fixture12(self): self.verify_fixture_file('astroid/recursion.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 131, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: "' For issue #25 '\n\n\nclass Base(object):\n    pass\n\n\n" != '""" For issue #25 """\n\n\n\nclass Base(object):\n    pass\n\n\n'
- ' For issue #25 '
? ^               ^
+ """ For issue #25 """
? ^^^               ^^^
+ 
  
  
  class Base(object):
      pass
  
  


======================================================================
FAIL: test_fixture13 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 150, in test_fixture13
    def test_fixture13(self): self.verify_fixture_file('astroid/suppliermodule_test.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 131, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: "' file suppliermodule.py '\n\n\nclass No[229 chars]\n\n" != '""" file suppliermodule.py """\n\n\n\ncl[235 chars]\n\n'
- ' file suppliermodule.py '
? ^                        ^
+ """ file suppliermodule.py """
? ^^^                        ^^^
+ 
  
  
  class NotImplemented(Exception):
      pass
  
  
  
  class Interface:
      
      def get_value(self):
          raise NotImplemented()
      
      def set_value(self, value):
          raise NotImplemented()
  
  
  
  class DoNothing:
      pass
  
  


======================================================================
FAIL: test_fixture4 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 141, in test_fixture4
    def test_fixture4(self): self.verify_fixture_file('astroid/clientmodule_test.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 131, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: '\' docstring for file clientmodule.py \'\[819 chars]\n\n' != '""" docstring for file clientmodule.py ""[827 chars]\n\n'
Diff is 1219 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_fixture6 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 143, in test_fixture6
    def test_fixture6(self): self.verify_fixture_file('astroid/email.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 131, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: '"fake email module to test absolute import doesn\'t grab this one"\n\n' != '"""fake email module to test absolute import doesn\'t grab this one"""\n\n\n\n'
- "fake email module to test absolute import doesn't grab this one"
+ """fake email module to test absolute import doesn't grab this one"""
? ++                                                                 ++
  
+ 
+ 


======================================================================
FAIL: test_to_source (tests.test_asttokens.TestASTTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_asttokens.py", line 91, in test_to_source
    self.assertEqual(tools.to_source(root).strip(), source)
AssertionError: "def foo():\n    'xxx'\n    None" != 'def foo():\n    """xxx"""\n    None'
  def foo():
-     'xxx'
+     """xxx"""
      None

======================================================================
FAIL: test_adjacent_strings (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 229, in test_adjacent_strings
    self.assertEqual(m.view_nodes_at(2, 6), {
AssertionError: Items in the first set but not the second:
"Constant:'x y z'"
Items in the second set but not the first:
'Str:\'x y z\' \\\n\'\'\'a b c\'\'\' "u v w"'

======================================================================
FAIL: test_conditional_expr (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 342, in test_conditional_expr
    self.assertEqual(m.view_nodes_at(1, 4),
AssertionError: Items in the first set but not the second:
'Constant:True'
Items in the second set but not the first:
'NameConstant:True'

======================================================================
FAIL: test_decorators (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 449, in test_decorators
    self.assertIn('FunctionDef:@deco1\ndef f():\n  pass', m.view_nodes_at(2, 0))
AssertionError: 'FunctionDef:@deco1\ndef f():\n  pass' not found in set()

======================================================================
FAIL: test_deep_recursion (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 183, in test_deep_recursion
    self.assertEqual(m.view_node(m.all_nodes[-1]),
AssertionError: "Constant:'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7'" != "Str:'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7'"
- Constant:'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7'
? ^^^^ ^^^
+ Str:'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7'
? ^ ^


======================================================================
FAIL: test_del_dict (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 391, in test_del_dict
    self.assertEqual(m.view_nodes_at(1, 5), {'Num:4'})
AssertionError: Items in the first set but not the second:
'Constant:4'
Items in the second set but not the first:
'Num:4'

======================================================================
FAIL: test_keyword_arg_only (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 431, in test_keyword_arg_only
    self.assertEqual(m.view_nodes_at(1, 4), {'Num:1'})
AssertionError: Items in the first set but not the second:
'Constant:1'
Items in the second set but not the first:
'Num:1'

======================================================================
FAIL: test_mark_tokens_multiline (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 95, in test_mark_tokens_multiline
    self.assertEqual(all_text, {
AssertionError: Items in the second set but not the first:
'a,      # line2\nb +     # line3\n  c +   # line4\n  d'

======================================================================
FAIL: test_slices (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 205, in test_slices
    self.assertEqual(m.view_nodes_at(1, 1),
AssertionError: Items in the second set but not the first:
'Tuple:foo.Area_Code, str(foo.Phone)[:3], str(foo.Phone)[3:], foo[:], bar[::, :]'

======================================================================
FAIL: test_walk_ast (tests.test_util.TestUtil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_util.py", line 43, in test_walk_ast
    self.assertEqual(scan, [
AssertionError: Lists differ: ["Mod[202 chars]2', 'Constant:1', 'Constant:2', "BinOp:'hello'[95 chars]ld'"] != ["Mod[202 chars]2', 'Num:1', 'Num:2', "BinOp:'hello' + ', ' + [70 chars]ld'"]

First differing element 7:
'Constant:1'
'Num:1'

  ["Module:foo(bar(1 + 2), 'hello' + ', ' + 'world')",
   "Expr:foo(bar(1 + 2), 'hello' + ', ' + 'world')",
   "Call:foo(bar(1 + 2), 'hello' + ', ' + 'world')",
   'Name:foo',
   'Call:bar(1 + 2)',
   'Name:bar',
   'BinOp:1 + 2',
-  'Constant:1',
-  'Constant:2',
+  'Num:1',
+  'Num:2',
   "BinOp:'hello' + ', ' + 'world'",
   "BinOp:'hello' + ', '",
-  "Constant:'hello'",
-  "Constant:', '",
-  "Constant:'world'"]
+  "Str:'hello'",
+  "Str:', '",
+  "Str:'world'"]

----------------------------------------------------------------------
Ran 79 tests in 0.833s

FAILED (SKIP=1, errors=20, failures=14)
ERROR: InvocationError for command '.../asttokens/.tox/py38/bin/nosetests' (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py38: commands failed
@hroncok
Copy link
Author

hroncok commented Apr 17, 2019

I get the same failures with Python 3.7. It's the asttokens version where things started to differ. I'll try to find out which.

@hroncok hroncok changed the title Python 3.8 test failures Astroid 2.2 test failures Apr 17, 2019
@hroncok
Copy link
Author

hroncok commented Apr 17, 2019

The failures start with astroid 2.2.

@vstinner
Copy link

I wrote PR #29 to "Fix some Python 3.8 issues".

@dsagal
Copy link
Member

dsagal commented May 1, 2019

I added a commit on master which fixes the issues caused by astroid 2.2

@keszybz
Copy link
Contributor

keszybz commented May 4, 2019

With the patch (git master at 21caaaa), tests pass with python3-astroid-2.2.5-1.fc30.noarch.rpm + python3-3.7.3-1.fc30.x86_64.rpm and python3-astroid-2.2.5-2.fc31.noarch + python3-3.7.3-2.fc31.x86_64 but fail with python3-3.8.0~a3-1.fc31.x86_64 + python3-astroid-2.2.5-2.fc31.noarch. Thus, it seems that compat with astroid is done, but compat with python3.8 not yet.

@hroncok
Copy link
Author

hroncok commented May 4, 2019

Here is the output with Python 3.8 on 21caaaa:

$ tox -e py38
GLOB sdist-make: .../asttokens/setup.py
py38 inst-nodeps: .../asttokens/.tox/.tmp/package/1/asttokens-1.1.13.zip
py38 installed: astroid==2.2.0,asttokens==1.1.13,coverage==4.5.3,lazy-object-proxy==1.3.1,nose==1.3.7,six==1.12.0,typed-ast==1.3.5,wrapt==1.11.1
py38 run-test-pre: PYTHONHASHSEED='303088453'
py38 runtests: commands[0] | nosetests
......S....FF..F.FFFF.......F......F.......F.EFFFF..........EE..FFE.....F....F.
======================================================================
ERROR: test_comprehensions (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 369, in test_comprehensions
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_mark_tokens.py", line 21, in create_mark_checker
    return tools.MarkChecker(source, parse=True)
  File ".../asttokens/tests/tools.py", line 105, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 65, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 76, in mark_tokens
    MarkTokens(self).visit_tree(root_node)
  File ".../asttokens/asttokens/mark_tokens.py", line 47, in visit_tree
    util.visit_tree(node, self._visit_before_children, self._visit_after_children)
  File ".../asttokens/asttokens/util.py", line 184, in visit_tree
    ret = postvisit(current, par_value, value)
  File ".../asttokens/asttokens/mark_tokens.py", line 90, in _visit_after_children
    nfirst, nlast = self._methods.get(self, node.__class__)(node, first, last)
  File ".../asttokens/asttokens/mark_tokens.py", line 175, in visit_listcomp
    return self.handle_comp('[', node, first_token, last_token)
  File ".../asttokens/asttokens/mark_tokens.py", line 171, in handle_comp
    util.expect_token(before, token.OP, open_brace)
  File ".../asttokens/asttokens/util.py", line 56, in expect_token
    raise ValueError("Expected token %s, got %s on line %s col %s" % (
ValueError: Expected token OP:'[', got ENDMARKER:'' on line 2 col 1

======================================================================
ERROR: test_fixture7 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 144, in test_fixture7
    def test_fixture7(self): self.verify_fixture_file('astroid/format.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_mark_tokens.py", line 21, in create_mark_checker
    return tools.MarkChecker(source, parse=True)
  File ".../asttokens/tests/tools.py", line 105, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 65, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 76, in mark_tokens
    MarkTokens(self).visit_tree(root_node)
  File ".../asttokens/asttokens/mark_tokens.py", line 47, in visit_tree
    util.visit_tree(node, self._visit_before_children, self._visit_after_children)
  File ".../asttokens/asttokens/util.py", line 184, in visit_tree
    ret = postvisit(current, par_value, value)
  File ".../asttokens/asttokens/mark_tokens.py", line 90, in _visit_after_children
    nfirst, nlast = self._methods.get(self, node.__class__)(node, first, last)
  File ".../asttokens/asttokens/mark_tokens.py", line 175, in visit_listcomp
    return self.handle_comp('[', node, first_token, last_token)
  File ".../asttokens/asttokens/mark_tokens.py", line 171, in handle_comp
    util.expect_token(before, token.OP, open_brace)
  File ".../asttokens/asttokens/util.py", line 56, in expect_token
    raise ValueError("Expected token %s, got %s on line %s col %s" % (
ValueError: Expected token OP:'[', got OP:'=' on line 7 col 3

======================================================================
ERROR: test_fixture8 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 145, in test_fixture8
    def test_fixture8(self): self.verify_fixture_file('astroid/module.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_mark_tokens.py", line 21, in create_mark_checker
    return tools.MarkChecker(source, parse=True)
  File ".../asttokens/tests/tools.py", line 105, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 65, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 76, in mark_tokens
    MarkTokens(self).visit_tree(root_node)
  File ".../asttokens/asttokens/mark_tokens.py", line 47, in visit_tree
    util.visit_tree(node, self._visit_before_children, self._visit_after_children)
  File ".../asttokens/asttokens/util.py", line 184, in visit_tree
    ret = postvisit(current, par_value, value)
  File ".../asttokens/asttokens/mark_tokens.py", line 90, in _visit_after_children
    nfirst, nlast = self._methods.get(self, node.__class__)(node, first, last)
  File ".../asttokens/asttokens/mark_tokens.py", line 175, in visit_listcomp
    return self.handle_comp('[', node, first_token, last_token)
  File ".../asttokens/asttokens/mark_tokens.py", line 171, in handle_comp
    util.expect_token(before, token.OP, open_brace)
  File ".../asttokens/asttokens/util.py", line 56, in expect_token
    raise ValueError("Expected token %s, got %s on line %s col %s" % (
ValueError: Expected token OP:'[', got OP:'=' on line 53 col 19

======================================================================
ERROR: test_mark_tokens_simple (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 47, in test_mark_tokens_simple
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_mark_tokens.py", line 21, in create_mark_checker
    return tools.MarkChecker(source, parse=True)
  File ".../asttokens/tests/tools.py", line 105, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 65, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 76, in mark_tokens
    MarkTokens(self).visit_tree(root_node)
  File ".../asttokens/asttokens/mark_tokens.py", line 47, in visit_tree
    util.visit_tree(node, self._visit_before_children, self._visit_after_children)
  File ".../asttokens/asttokens/util.py", line 184, in visit_tree
    ret = postvisit(current, par_value, value)
  File ".../asttokens/asttokens/mark_tokens.py", line 90, in _visit_after_children
    nfirst, nlast = self._methods.get(self, node.__class__)(node, first, last)
  File ".../asttokens/asttokens/mark_tokens.py", line 175, in visit_listcomp
    return self.handle_comp('[', node, first_token, last_token)
  File ".../asttokens/asttokens/mark_tokens.py", line 171, in handle_comp
    util.expect_token(before, token.OP, open_brace)
  File ".../asttokens/asttokens/util.py", line 56, in expect_token
    raise ValueError("Expected token %s, got %s on line %s col %s" % (
ValueError: Expected token OP:'[', got OP:'=' on line 53 col 19

======================================================================
FAIL: test_fixture12 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 149, in test_fixture12
    def test_fixture12(self): self.verify_fixture_file('astroid/recursion.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 149, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: "' For issue #25 '\n\n\nclass Base(object):\n    pass\n\n\n" != '""" For issue #25 """\n\n\n\nclass Base(object):\n    pass\n\n\n'
- ' For issue #25 '
? ^               ^
+ """ For issue #25 """
? ^^^               ^^^
+ 
  
  
  class Base(object):
      pass
  
  


======================================================================
FAIL: test_fixture13 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 150, in test_fixture13
    def test_fixture13(self): self.verify_fixture_file('astroid/suppliermodule_test.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 149, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: "' file suppliermodule.py '\n\n\nclass No[229 chars]\n\n" != '""" file suppliermodule.py """\n\n\n\ncl[235 chars]\n\n'
- ' file suppliermodule.py '
? ^                        ^
+ """ file suppliermodule.py """
? ^^^                        ^^^
+ 
  
  
  class NotImplemented(Exception):
      pass
  
  
  
  class Interface:
      
      def get_value(self):
          raise NotImplemented()
      
      def set_value(self, value):
          raise NotImplemented()
  
  
  
  class DoNothing:
      pass
  
  


======================================================================
FAIL: test_fixture4 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 141, in test_fixture4
    def test_fixture4(self): self.verify_fixture_file('astroid/clientmodule_test.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 149, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: '\' docstring for file clientmodule.py \'\[819 chars]\n\n' != '""" docstring for file clientmodule.py ""[827 chars]\n\n'
Diff is 1219 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_fixture6 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 143, in test_fixture6
    def test_fixture6(self): self.verify_fixture_file('astroid/email.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 149, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: '"fake email module to test absolute import doesn\'t grab this one"\n\n' != '"""fake email module to test absolute import doesn\'t grab this one"""\n\n\n\n'
- "fake email module to test absolute import doesn't grab this one"
+ """fake email module to test absolute import doesn't grab this one"""
? ++                                                                 ++
  
+ 
+ 


======================================================================
FAIL: test_fixture7 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 144, in test_fixture7
    def test_fixture7(self): self.verify_fixture_file('astroid/format.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 149, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: "'A multiline string\\n'\nfunction('aeozr[290 chars]\n\n" != '"""A multiline string\n"""\n\nfunction(\[297 chars]\n\n'
- 'A multiline string\n'
? ^                  ---
+ """A multiline string
? ^^^
+ """
+ 
  function('aeozrijzearzer', hop)
  x = [i for i in range(5) if i % 4]
  fonction(1, 2, 3, 4)
  
  def definition(a, b, c):
      return a + b + c
  
  
  class debile(dict, object):
      pass
  
  if aaaa:
      pass
  else:
      (aaaa, bbbb) = (1, 2)
      (aaaa, bbbb) = (bbbb, aaaa)
  hop = aaaa
  __revision__.lower()
  


======================================================================
FAIL: test_fixture8 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 145, in test_fixture8
    def test_fixture8(self): self.verify_fixture_file('astroid/module.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 149, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: "'test module for astroid\\n'\n__revision[1773 chars]\n\n" != '"""test module for astroid\n"""\n\n__rev[1808 chars]\n\n'
Diff is 2477 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_fixture9 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 146, in test_fixture9
    def test_fixture9(self): self.verify_fixture_file('astroid/module2.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 108, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 149, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: "from data.module import YO, YOUPI\nimpor[1976 chars]\n\n" != 'from data.module import YO, YOUPI\nimpor[2020 chars]\n\n'
Diff is 2689 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_print_function (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 250, in test_print_function
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 149, in verify_all_nodes
    test_case.assertEqual(left, right)
AssertionError: "try:\n    enumerate = enumerate\nexcept [1093 chars]\n\n" != 'try:\n    enumerate = enumerate\nexcept [1131 chars]\n\n'
Diff is 1797 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_to_source (tests.test_asttokens.TestASTTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_asttokens.py", line 91, in test_to_source
    self.assertEqual(tools.to_source(root).strip(), source)
AssertionError: "def foo():\n    'xxx'\n    None" != 'def foo():\n    """xxx"""\n    None'
  def foo():
-     'xxx'
+     """xxx"""
      None

======================================================================
FAIL: test_adjacent_strings (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 229, in test_adjacent_strings
    self.assertEqual(m.view_nodes_at(2, 6), {
AssertionError: Items in the first set but not the second:
"Constant:'x y z'"
Items in the second set but not the first:
'Str:\'x y z\' \\\n\'\'\'a b c\'\'\' "u v w"'

======================================================================
FAIL: test_conditional_expr (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 342, in test_conditional_expr
    self.assertEqual(m.view_nodes_at(1, 4),
AssertionError: Items in the first set but not the second:
'Constant:True'
Items in the second set but not the first:
'NameConstant:True'

======================================================================
FAIL: test_decorators (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 449, in test_decorators
    self.assertIn('FunctionDef:@deco1\ndef f():\n  pass', m.view_nodes_at(2, 0))
AssertionError: 'FunctionDef:@deco1\ndef f():\n  pass' not found in set()

======================================================================
FAIL: test_deep_recursion (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 183, in test_deep_recursion
    self.assertEqual(m.view_node(m.all_nodes[-1]),
AssertionError: "Constant:'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7'" != "Str:'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7'"
- Constant:'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7'
? ^^^^ ^^^
+ Str:'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7'
? ^ ^


======================================================================
FAIL: test_del_dict (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 391, in test_del_dict
    self.assertEqual(m.view_nodes_at(1, 5), {'Num:4'})
AssertionError: Items in the first set but not the second:
'Constant:4'
Items in the second set but not the first:
'Num:4'

======================================================================
FAIL: test_keyword_arg_only (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 431, in test_keyword_arg_only
    self.assertEqual(m.view_nodes_at(1, 4), {'Num:1'})
AssertionError: Items in the first set but not the second:
'Constant:1'
Items in the second set but not the first:
'Num:1'

======================================================================
FAIL: test_mark_tokens_multiline (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 95, in test_mark_tokens_multiline
    self.assertEqual(all_text, {
AssertionError: Items in the second set but not the first:
'a,      # line2\nb +     # line3\n  c +   # line4\n  d'

======================================================================
FAIL: test_slices (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 205, in test_slices
    self.assertEqual(m.view_nodes_at(1, 1),
AssertionError: Items in the second set but not the first:
'Tuple:foo.Area_Code, str(foo.Phone)[:3], str(foo.Phone)[3:], foo[:], bar[::, :]'

======================================================================
FAIL: test_walk_ast (tests.test_util.TestUtil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_util.py", line 43, in test_walk_ast
    self.assertEqual(scan, [
AssertionError: Lists differ: ["Mod[202 chars]2', 'Constant:1', 'Constant:2', "BinOp:'hello'[95 chars]ld'"] != ["Mod[202 chars]2', 'Num:1', 'Num:2', "BinOp:'hello' + ', ' + [70 chars]ld'"]

First differing element 7:
'Constant:1'
'Num:1'

  ["Module:foo(bar(1 + 2), 'hello' + ', ' + 'world')",
   "Expr:foo(bar(1 + 2), 'hello' + ', ' + 'world')",
   "Call:foo(bar(1 + 2), 'hello' + ', ' + 'world')",
   'Name:foo',
   'Call:bar(1 + 2)',
   'Name:bar',
   'BinOp:1 + 2',
-  'Constant:1',
-  'Constant:2',
+  'Num:1',
+  'Num:2',
   "BinOp:'hello' + ', ' + 'world'",
   "BinOp:'hello' + ', '",
-  "Constant:'hello'",
-  "Constant:', '",
-  "Constant:'world'"]
+  "Str:'hello'",
+  "Str:', '",
+  "Str:'world'"]

----------------------------------------------------------------------
Ran 79 tests in 0.884s

FAILED (SKIP=1, errors=4, failures=18)
ERROR: InvocationError for command '.../asttokens/.tox/py38/bin/nosetests' (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py38: commands failed

@hroncok
Copy link
Author

hroncok commented May 4, 2019

This is due to python/cpython#9445

Class ast.Constant is now used for all constants. Old classes ast.Num, ast.Str, ast.Bytes, ast.NameConstant and ast.Ellipsis are still available, but they will be removed in future Python releases.

@dsagal
Copy link
Member

dsagal commented May 4, 2019 via email

keszybz added a commit to keszybz/asttokens that referenced this issue Jun 18, 2019
This fixes some test failures under python3.8. All tests still pass on
python3.7. Partially addresses gristlabs#28, replaces gristlabs#29.
As suggested in https://github.com/gristlabs/asttokens/pull/29/files#r280123329.
keszybz added a commit to keszybz/astroid that referenced this issue Jun 18, 2019
It is stored as a Constant, not a Str, so we the the value a bit
differently.

Fixes one test failure in gristlabs/asttokens#28.
dsagal pushed a commit that referenced this issue Jun 19, 2019
This fixes some test failures under python3.8. All tests still pass on
python3.7. Partially addresses #28, replaces #29.
As suggested in https://github.com/gristlabs/asttokens/pull/29/files#r280123329.
PCManticore pushed a commit to pylint-dev/astroid that referenced this issue Jul 6, 2019
It is stored as a Constant, not a Str, so we the the value a bit
differently.

Fixes one test failure in gristlabs/asttokens#28.
@keszybz
Copy link
Contributor

keszybz commented Jul 12, 2019

It's a bit better now, but many failures still:
FAILED (SKIP=1, errors=8, failures=6)

@keszybz
Copy link
Contributor

keszybz commented Aug 18, 2019

Anything we can do from the Fedora side to move this forward? I'd be happy to provide a test environment with all the packages installed to make debugging easier.

@alexmojaki
Copy link
Contributor

Python 3.8.0rc1 is out, which is supposed to mean no more code changes. The official release is expected in 2 weeks. Many tests are still failing on 3.8 that are unrelated to astroid. Can we change the title to "Astroid 2.2 and Python 3.8 test failures"? Is there any work currently being done on this? I'm planning to take a crack at it soon, but I haven't actually worked with this codebase before.

@dsagal dsagal changed the title Astroid 2.2 test failures Astroid 2.2 and Python 3.8 test failures Oct 2, 2019
@dsagal
Copy link
Member

dsagal commented Oct 2, 2019

It looks doable, I'll give it a shot this week.

@alexmojaki
Copy link
Contributor

This can be closed now :)

@dsagal dsagal closed this as completed Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants