gristlabs / asttokens

Annotate Python AST trees with source text and token information
Apache License 2.0
172 stars 34 forks source link

Tests fail with astroid 2.0.0 (needed for Python 3.7) #16

Closed hroncok closed 6 years ago

hroncok commented 6 years ago

Astroid 2.0.0devX is the first astroid to support Python 3.7 at all, so the only way to use asttokens on Python 3.7 is with astroid 2.0.0, but that doesn't work:

$ tox --pre -r -e py36
GLOB sdist-make: .../asttokens/setup.py
py36 recreate: .../asttokens/.tox/py36
py36 installdeps: nose, astroid, coverage
py36 inst: .../asttokens/.tox/dist/asttokens-1.1.10.zip
py36 installed: astroid==2.0.0.dev1,asttokens==1.1.10,coverage==4.5.1,lazy-object-proxy==1.3.1,nose==1.3.7,six==1.11.0,typed-ast==1.1.0,wrapt==1.10.11
py36 runtests: PYTHONHASHSEED='3250051827'
py36 runtests: commands[0] | nosetests
F.E...E..E.FF..F.FEEEE...E.EE....F........E......E........EEE....E.EE.......
======================================================================
ERROR: test_calling_lambdas (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 345, in test_calling_lambdas
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 345, in visit_call
    newnode.postinit(self.visit(node.func, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 623, in visit_lambda
    self.visit(node.body, newnode))
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_deep_recursion (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 160, in test_deep_recursion
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_astroid.py", line 14, in create_mark_checker
    tree = builder.string_build(source)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/builder.py", line 154, in string_build
    module = self._data_build(data, modname, path)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/builder.py", line 195, in _data_build
    module = builder.visit_module(node, modname, node_file, package)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
    ...snip...
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 297, in visit_binop
    node.lineno, node.col_offset, parent)
RecursionError: maximum recursion depth exceeded

======================================================================
ERROR: test_fixture10 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 146, in test_fixture10
    def test_fixture10(self): self.verify_fixture_file('astroid/noendingnewline.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 581, in visit_if
    newnode.postinit(self.visit(node.test, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 391, in visit_compare
    for (op, expr) in zip(node.ops, node.comparators)])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 391, in <listcomp>
    for (op, expr) in zip(node.ops, node.comparators)])
KeyError: <class '_ast.Eq'>

======================================================================
ERROR: test_fixture7 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 143, 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
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 642, in visit_listcomp
    for child in node.generators])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 642, in <listcomp>
    for child in node.generators])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 400, in visit_comprehension
    for child in node.ifs],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 400, in <listcomp>
    for child in node.ifs],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.Mod'>

======================================================================
ERROR: test_fixture8 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 144, 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
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 919, in visit_classdef
    newstyle=newstyle)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 367, in visit_classdef
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 367, in <listcomp>
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 539, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in _visit_functiondef
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in <listcomp>
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 870, in visit_try
    for child in node.body]
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 870, in <listcomp>
    for child in node.body]
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 581, in visit_if
    newnode.postinit(self.visit(node.test, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 391, in visit_compare
    for (op, expr) in zip(node.ops, node.comparators)])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 391, in <listcomp>
    for (op, expr) in zip(node.ops, node.comparators)])
KeyError: <class '_ast.In'>

======================================================================
ERROR: test_fixture9 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 145, in test_fixture9
    def test_fixture9(self): self.verify_fixture_file('astroid/module2.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.BitOr'>

======================================================================
ERROR: test_fstrings (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 276, in test_fstrings
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_astroid.py", line 15, in create_mark_checker
    return tools.MarkChecker(source, tree=tree)
  File ".../asttokens/tests/tools.py", line 82, in __init__
    self.atok = asttokens.ASTTokens(source, parse=parse, tree=tree)
  File ".../asttokens/asttokens/asttokens.py", line 62, in __init__
    self.mark_tokens(self._tree)
  File ".../asttokens/asttokens/asttokens.py", line 73, 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 170, 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 264, in visit_keyword
    util.expect_token(name, token.NAME, node.arg)
  File ".../asttokens/asttokens/util.py", line 58, in expect_token
    token.start[0], token.start[1] + 1))
ValueError: Expected token NAME:'kwarg', got STRING:"f'{function(kwarg=24)}'" on line 1 col 1

======================================================================
ERROR: test_nonascii (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 256, in test_nonascii
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_print_function (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 242, in test_print_function
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 876, in visit_try
    return self.visit_tryexcept(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 747, in visit_tryexcept
    for child in node.handlers],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 747, in <listcomp>
    for child in node.handlers],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 836, in visit_excepthandler
    for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 836, in <listcomp>
    for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 539, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in _visit_functiondef
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in <listcomp>
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 505, in visit_for
    return self._visit_for(nodes.For, node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 498, in _visit_for
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 498, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 282, in visit_augassign
    newnode = nodes.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 395, in test_return_annotation
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 539, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in _visit_functiondef
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in <listcomp>
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 704, in visit_return
    newnode.postinit(self.visit(node.value, newnode))
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
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 345, in test_calling_lambdas
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 345, in visit_call
    newnode.postinit(self.visit(node.func, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 623, in visit_lambda
    self.visit(node.body, newnode))
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_fixture10 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 146, in test_fixture10
    def test_fixture10(self): self.verify_fixture_file('astroid/noendingnewline.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 581, in visit_if
    newnode.postinit(self.visit(node.test, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 391, in visit_compare
    for (op, expr) in zip(node.ops, node.comparators)])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 391, in <listcomp>
    for (op, expr) in zip(node.ops, node.comparators)])
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 143, 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
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 642, in visit_listcomp
    for child in node.generators])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 642, in <listcomp>
    for child in node.generators])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 400, in visit_comprehension
    for child in node.ifs],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 400, in <listcomp>
    for child in node.ifs],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.Mod'>

======================================================================
ERROR: test_fixture8 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 144, 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
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 919, in visit_classdef
    newstyle=newstyle)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 367, in visit_classdef
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 367, in <listcomp>
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 539, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in _visit_functiondef
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in <listcomp>
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 870, in visit_try
    for child in node.body]
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 870, in <listcomp>
    for child in node.body]
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 581, in visit_if
    newnode.postinit(self.visit(node.test, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 391, in visit_compare
    for (op, expr) in zip(node.ops, node.comparators)])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 391, in <listcomp>
    for (op, expr) in zip(node.ops, node.comparators)])
KeyError: <class '_ast.In'>

======================================================================
ERROR: test_fixture9 (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 145, in test_fixture9
    def test_fixture9(self): self.verify_fixture_file('astroid/module2.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.BitOr'>

======================================================================
ERROR: test_nonascii (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 256, in test_nonascii
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign
    value=self.visit(node.value, newnode),
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.Add'>

======================================================================
ERROR: test_print_function (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 242, in test_print_function
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 876, in visit_try
    return self.visit_tryexcept(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 747, in visit_tryexcept
    for child in node.handlers],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 747, in <listcomp>
    for child in node.handlers],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 836, in visit_excepthandler
    for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 836, in <listcomp>
    for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 539, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in _visit_functiondef
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in <listcomp>
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 505, in visit_for
    return self._visit_for(nodes.For, node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 498, in _visit_for
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 498, in <listcomp>
    body=[self.visit(child, newnode) for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 282, in visit_augassign
    newnode = nodes.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 395, in test_return_annotation
    m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
  File ".../asttokens/tests/tools.py", line 59, in to_source
    anode = builder.visit_module(node_copy, '', '', '')
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 539, in visit_functiondef
    return self._visit_functiondef(nodes.FunctionDef, node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in _visit_functiondef
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 533, in <listcomp>
    for child in node.body],
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 704, in visit_return
    newnode.postinit(self.visit(node.value, newnode))
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
  File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop
    newnode = nodes.BinOp(self._bin_op_classes[type(node.op)],
KeyError: <class '_ast.Add'>

======================================================================
FAIL: test_adjacent_joined_strings (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 290, in test_adjacent_joined_strings
    "JoinedStr:f'x y z' \\\nf'''a b c''' f\"u v w\""
AssertionError: Items in the first set but not the second:
'Const:f\'x y z\' \\\nf\'\'\'a b c\'\'\' f"u v w"'
Items in the second set but not the first:
'JoinedStr:f\'x y z\' \\\nf\'\'\'a b c\'\'\' f"u v w"'

======================================================================
FAIL: test_fixture12 (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 148, in test_fixture12
    def test_fixture12(self): self.verify_fixture_file('astroid/recursion.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
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 149, in test_fixture13
    def test_fixture13(self): self.verify_fixture_file('astroid/suppliermodule_test.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
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 140, in test_fixture4
    def test_fixture4(self): self.verify_fixture_file('astroid/clientmodule_test.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
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 142, in test_fixture6
    def test_fixture6(self): self.verify_fixture_file('astroid/email.py')
  File ".../asttokens/tests/test_mark_tokens.py", line 107, in verify_fixture_file
    tested_nodes = m.verify_all_nodes(self)
  File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes
    test_case.assertEqual(to_source(rebuilt_node), to_source(node))
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

----------------------------------------------------------------------
Ran 76 tests in 0.917s

FAILED (errors=18, failures=6)
ERROR: InvocationError: '.../asttokens/.tox/py36/bin/nosetests'
___________________________________ summary ____________________________________
ERROR:   py36: commands failed
$ tox --pre -r -e py37
GLOB sdist-make: .../asttokens/setup.py
py37 recreate: .../asttokens/.tox/py37
py37 installdeps: nose, astroid, coverage
py37 inst: .../asttokens/.tox/dist/asttokens-1.1.10.zip
py37 installed: astroid==2.0.0.dev1,asttokens==1.1.10,coverage==4.5.1,lazy-object-proxy==1.3.1,nose==1.3.7,six==1.11.0,wrapt==1.10.11
py37 runtests: PYTHONHASHSEED='1682714241'
py37 runtests: commands[0] | nosetests
FF....E...........................F.....FF..................................
======================================================================
ERROR: test_deep_recursion (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 160, in test_deep_recursion
    m = self.create_mark_checker(source)
  File ".../asttokens/tests/test_astroid.py", line 14, in create_mark_checker
    tree = builder.string_build(source)
  File ".../asttokens/.tox/py37/lib/python3.7/site-packages/astroid/builder.py", line 154, in string_build
    module = self._data_build(data, modname, path)
  File ".../asttokens/.tox/py37/lib/python3.7/site-packages/astroid/builder.py", line 195, in _data_build
    module = builder.visit_module(node, modname, node_file, package)
  File ".../asttokens/.tox/py37/lib/python3.7/site-packages/astroid/rebuilder.py", line 152, in visit_module
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py37/lib/python3.7/site-packages/astroid/rebuilder.py", line 152, in <listcomp>
    newnode.postinit([self.visit(child, newnode) for child in node.body])
  File ".../asttokens/.tox/py37/lib/python3.7/site-packages/astroid/rebuilder.py", line 164, in visit
    return visit_method(node, parent)
    ...snip...
  File ".../asttokens/.tox/py37/lib/python3.7/site-packages/astroid/rebuilder.py", line 297, in visit_binop
    node.lineno, node.col_offset, parent)
RecursionError: maximum recursion depth exceeded

======================================================================
FAIL: test_adjacent_joined_strings (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 293, in test_adjacent_joined_strings
    "JoinedStr:'x y z'   # comment2\n       'a b c'   # comment3\n       f'u v w'"
AssertionError: Items in the first set but not the second:
"JoinedStr:'x y z'"
Items in the second set but not the first:
"JoinedStr:'x y z'   # comment2\n       'a b c'   # comment3\n       f'u v w'"

======================================================================
FAIL: test_adjacent_strings (tests.test_astroid.TestAstroid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 225, in test_adjacent_strings
    node_name + ":'x y z'   # comment2\n       'a b c'   # comment3\n       'u v w'"
AssertionError: Items in the first set but not the second:
"Const:'x y z'"
Items in the second set but not the first:
"Const:'x y z'   # comment2\n       'a b c'   # comment3\n       'u v w'"

======================================================================
FAIL: test_token_methods (tests.test_asttokens.TestASTTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_asttokens.py", line 46, in test_token_methods
    self.assertEqual(atok.prev_token(atok.tokens[5]), atok.tokens[3])
AssertionError: Token(type=56, string='\n', start=(2, 0), end=(2, 1)[40 chars]s=22) != Token(type=4, string='\n', start=(1, 20), end=(1, 21[61 chars]s=21)

======================================================================
FAIL: test_adjacent_joined_strings (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 293, in test_adjacent_joined_strings
    "JoinedStr:'x y z'   # comment2\n       'a b c'   # comment3\n       f'u v w'"
AssertionError: Items in the first set but not the second:
"JoinedStr:'x y z'"
Items in the second set but not the first:
"JoinedStr:'x y z'   # comment2\n       'a b c'   # comment3\n       f'u v w'"

======================================================================
FAIL: test_adjacent_strings (tests.test_mark_tokens.TestMarkTokens)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../asttokens/tests/test_mark_tokens.py", line 225, in test_adjacent_strings
    node_name + ":'x y z'   # comment2\n       'a b c'   # comment3\n       'u v w'"
AssertionError: Items in the first set but not the second:
"Str:'x y z'"
Items in the second set but not the first:
"Str:'x y z'   # comment2\n       'a b c'   # comment3\n       'u v w'"

----------------------------------------------------------------------
Ran 76 tests in 1.659s

FAILED (errors=1, failures=5)
ERROR: InvocationError: '.../asttokens/.tox/py37/bin/nosetests'
___________________________________ summary ____________________________________
ERROR:   py37: commands failed
hroncok commented 6 years ago

I've opened https://github.com/PyCQA/astroid/issues/557 for the recursion thing.

hroncok commented 6 years ago

The RecursionError is not a big deal and the test should be removed according to astroid developers.