Skip to content

Test failures in Python 3.14, due to ast.Num removal #48

@mgorny

Description

@mgorny
$ pytest tests/test_more.py 
========================================================= test session starts =========================================================
platform linux -- Python 3.14.0, pytest-8.4.2, pluggy-1.6.0
rootdir: /tmp/unification
configfile: pyproject.toml
collected 8 items                                                                                                                     

tests/test_more.py .F.F....                                                                                                     [100%]

============================================================== FAILURES ===============================================================
____________________________________________________ test_unify_nonstandard_object ____________________________________________________

    def test_unify_nonstandard_object():
        _unify.add((ast.AST, ast.AST, Mapping), _unify_object)
        x = var()
>       assert unify(ast.Num(n=1), ast.Num(n=1), {}) == {}
                     ^^^^^^^
E       AttributeError: module 'ast' has no attribute 'Num'

tests/test_more.py:36: AttributeError
____________________________________________________ test_reify_nonstandard_object ____________________________________________________

    def test_reify_nonstandard_object():
        _reify.add((ast.AST, Mapping), _reify_object)
        x = var()
>       assert reify(ast.Num(n=1), {}).n == 1
                     ^^^^^^^
E       AttributeError: module 'ast' has no attribute 'Num'

tests/test_more.py:54: AttributeError
======================================================= short test summary info =======================================================
FAILED tests/test_more.py::test_unify_nonstandard_object - AttributeError: module 'ast' has no attribute 'Num'
FAILED tests/test_more.py::test_reify_nonstandard_object - AttributeError: module 'ast' has no attribute 'Num'
===================================================== 2 failed, 6 passed in 0.07s =====================================================

FWIU these need to be replaced by ast.Constant.

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