Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

tests.test_trees.TestTrees.test_smart_decorator fails with python 3.11 #1146

Copy link
Copy link
Closed
@mgorny

Description

@mgorny
Issue body actions

Describe the bug

When running the test suite (without js2py installed, see PiotrDabkowski/Js2Py#282), the following test fails:

======================================================================
ERROR: test_smart_decorator (tests.test_trees.TestTrees.test_smart_decorator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/lark/lark/visitors.py", line 114, in _call_userfunc
    return f.visit_wrapper(f, tree.data, children, tree.meta)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/lark/lark/visitors.py", line 491, in _vargs_inline
    return f(*children)
           ^^^^^^^^^^^^
  File "/tmp/lark/lark/visitors.py", line 471, in __call__
    return self.base_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/lark/tests/test_trees.py", line 191, in ab_classmethod
    assert cls is OtherClass, cls
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: <tests.test_trees.TestTrees.test_smart_decorator.<locals>.TestCls object at 0x7f5bcf0c7390>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/lark/tests/test_trees.py", line 293, in test_smart_decorator
    result = test_instance.transform(Tree(method_name, children))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/lark/lark/visitors.py", line 153, in transform
    return self._transform_tree(tree)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/lark/lark/visitors.py", line 149, in _transform_tree
    return self._call_userfunc(tree, children)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/lark/lark/visitors.py", line 120, in _call_userfunc
    raise VisitError(tree.data, tree, e)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lark.exceptions.VisitError: Error trying to process rule "oc_ab_classmethod":

<tests.test_trees.TestTrees.test_smart_decorator.<locals>.TestCls object at 0x7f5bcf0c7390>

To Reproduce

python3.11 -m venv .venv
. .venv/bin/activate
python -m tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.