Skip to content

Test failure with Python 3.13.0b1 #533

Closed
@frenzymadness

Description

@frenzymadness

This assertion fails:

assert list(clsdict.keys()) == ["C_CONSTANT", "__doc__", "method_c"]

with the following error:

=================================== FAILURES ===================================
___________________________ test_extract_class_dict ____________________________

    def test_extract_class_dict():
        class A(int):
            """A docstring"""
    
            def method(self):
                return "a"
    
        class B:
            """B docstring"""
    
            B_CONSTANT = 42
    
            def method(self):
                return "b"
    
        class C(A, B):
            C_CONSTANT = 43
    
            def method_c(self):
                return "c"
    
        clsdict = _extract_class_dict(C)
>       assert sorted(clsdict.keys()) == ["C_CONSTANT", "__doc__", "method_c"]
E       AssertionError: assert ['C_CONSTANT'...', 'method_c'] == ['C_CONSTANT'...', 'method_c']
E         At index 2 diff: '__firstlineno__' != 'method_c'
E         Left contains one more item: 'method_c'
E         Full diff:
E         - ['C_CONSTANT', '__doc__', 'method_c']
E         + ['C_CONSTANT', '__doc__', '__firstlineno__', 'method_c']
E         ?                          +++++++++++++++++++

tests/cloudpickle_test.py:111: AssertionError
=========================== short test summary info ============================
FAILED tests/cloudpickle_test.py::test_extract_class_dict - AssertionError: a...
============ 1 failed, 232 passed, 25 skipped, 2 warnings in 11.75s ============

This change in Python seems to be related: python/cpython#118475

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