Bug 2186499

Summary: python-astroid fails to build with Python 3.12: AssertionError: assert 'builtins.classobj' == 'builtins.str'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-astroidAssignee: Gwyn Ciesla <gwync>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gwync, mhroncok, orion, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-astroid-3.0.0~a6~202306288d57ce2-1.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-04 03:21:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2135404    

Description Tomáš Hrnčiar 2023-04-13 13:55:28 UTC
python-astroid fails to build with Python 3.12.0a7.


=================================== FAILURES ===================================
______________ test_ctypes_redefined_types_members[c_bool-bool-?] ______________

c_type = 'c_bool', builtin_type = 'bool', type_code = '?'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.bool'
E         - builtins.bool
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_byte-int-b] _______________

c_type = 'c_byte', builtin_type = 'int', type_code = 'b'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_____________ test_ctypes_redefined_types_members[c_char-bytes-c] ______________

c_type = 'c_char', builtin_type = 'bytes', type_code = 'c'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.bytes'
E         - builtins.bytes
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
____________ test_ctypes_redefined_types_members[c_double-float-d] _____________

c_type = 'c_double', builtin_type = 'float', type_code = 'd'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.float'
E         - builtins.float
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_____________ test_ctypes_redefined_types_members[c_float-float-f] _____________

c_type = 'c_float', builtin_type = 'float', type_code = 'f'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.float'
E         - builtins.float
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_______________ test_ctypes_redefined_types_members[c_int-int-i] _______________

c_type = 'c_int', builtin_type = 'int', type_code = 'i'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_int16-int-h] ______________

c_type = 'c_int16', builtin_type = 'int', type_code = 'h'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_int32-int-i] ______________

c_type = 'c_int32', builtin_type = 'int', type_code = 'i'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_int64-int-l] ______________

c_type = 'c_int64', builtin_type = 'int', type_code = 'l'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_int8-int-b] _______________

c_type = 'c_int8', builtin_type = 'int', type_code = 'b'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_long-int-l] _______________

c_type = 'c_long', builtin_type = 'int', type_code = 'l'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
__________ test_ctypes_redefined_types_members[c_longdouble-float-g] ___________

c_type = 'c_longdouble', builtin_type = 'float', type_code = 'g'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.float'
E         - builtins.float
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
____________ test_ctypes_redefined_types_members[c_longlong-int-l] _____________

c_type = 'c_longlong', builtin_type = 'int', type_code = 'l'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_short-int-h] ______________

c_type = 'c_short', builtin_type = 'int', type_code = 'h'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_____________ test_ctypes_redefined_types_members[c_size_t-int-L] ______________

c_type = 'c_size_t', builtin_type = 'int', type_code = 'L'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_____________ test_ctypes_redefined_types_members[c_ssize_t-int-l] _____________

c_type = 'c_ssize_t', builtin_type = 'int', type_code = 'l'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_ubyte-int-B] ______________

c_type = 'c_ubyte', builtin_type = 'int', type_code = 'B'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_uint-int-I] _______________

c_type = 'c_uint', builtin_type = 'int', type_code = 'I'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_____________ test_ctypes_redefined_types_members[c_uint16-int-H] ______________

c_type = 'c_uint16', builtin_type = 'int', type_code = 'H'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_____________ test_ctypes_redefined_types_members[c_uint32-int-I] ______________

c_type = 'c_uint32', builtin_type = 'int', type_code = 'I'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_____________ test_ctypes_redefined_types_members[c_uint64-int-L] ______________

c_type = 'c_uint64', builtin_type = 'int', type_code = 'L'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_uint8-int-B] ______________

c_type = 'c_uint8', builtin_type = 'int', type_code = 'B'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_ulong-int-L] ______________

c_type = 'c_ulong', builtin_type = 'int', type_code = 'L'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
____________ test_ctypes_redefined_types_members[c_ulonglong-int-L] ____________

c_type = 'c_ulonglong', builtin_type = 'int', type_code = 'L'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
_____________ test_ctypes_redefined_types_members[c_ushort-int-H] ______________

c_type = 'c_ushort', builtin_type = 'int', type_code = 'H'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.int'
E         - builtins.int
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
______________ test_ctypes_redefined_types_members[c_wchar-str-u] ______________

c_type = 'c_wchar', builtin_type = 'str', type_code = 'u'

    @pytest.mark.parametrize(
        "c_type,builtin_type,type_code",
        [
            ("c_bool", "bool", "?"),
            ("c_byte", "int", "b"),
            ("c_char", "bytes", "c"),
            ("c_double", "float", "d"),
            pytest.param(
                "c_buffer",
                "bytes",
                "<class 'ctypes.c_char'>",
                marks=pytest.mark.xfail(
                    reason="c_buffer is Uninferable but for now we do not know why"
                ),
            ),
            ("c_float", "float", "f"),
            ("c_int", "int", "i"),
            ("c_int16", "int", "h"),
            ("c_int32", "int", "i"),
            ("c_int64", "int", "l"),
            ("c_int8", "int", "b"),
            ("c_long", "int", "l"),
            ("c_longdouble", "float", "g"),
            ("c_longlong", "int", "l"),
            ("c_short", "int", "h"),
            ("c_size_t", "int", "L"),
            ("c_ssize_t", "int", "l"),
            ("c_ubyte", "int", "B"),
            ("c_uint", "int", "I"),
            ("c_uint16", "int", "H"),
            ("c_uint32", "int", "I"),
            ("c_uint64", "int", "L"),
            ("c_uint8", "int", "B"),
            ("c_ulong", "int", "L"),
            ("c_ulonglong", "int", "L"),
            ("c_ushort", "int", "H"),
            ("c_wchar", "str", "u"),
        ],
    )
    def test_ctypes_redefined_types_members(c_type, builtin_type, type_code):
        """Test that the "value" and "_type_" member of each redefined types are
        correct.
        """
        src = f"""
        import ctypes
        x=ctypes.{c_type}("toto")
        x.value
        """
        node = extract_node(src)
        assert isinstance(node, nodes.NodeNG)
        node_inf = node.inferred()[0]
>       assert node_inf.pytype() == f"builtins.{builtin_type}"
E       AssertionError: assert 'builtins.classobj' == 'builtins.str'
E         - builtins.str
E         + builtins.classobj

tests/brain/test_ctypes.py:71: AssertionError
=========================== short test summary info ============================
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_bool-bool-?]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_byte-int-b]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_char-bytes-c]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_double-float-d]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_float-float-f]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_int-int-i]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_int16-int-h]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_int32-int-i]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_int64-int-l]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_int8-int-b]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_long-int-l]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_longdouble-float-g]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_longlong-int-l]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_short-int-h]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_size_t-int-L]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_ssize_t-int-l]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_ubyte-int-B]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_uint-int-I]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_uint16-int-H]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_uint32-int-I]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_uint64-int-L]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_uint8-int-B]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_ulong-int-L]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_ulonglong-int-L]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_ushort-int-H]
FAILED tests/brain/test_ctypes.py::test_ctypes_redefined_types_members[c_wchar-str-u]
=========== 26 failed, 1451 passed, 58 skipped, 14 xfailed in 23.46s ===========

https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05778913-python-astroid/

For all our attempts to build python-astroid with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/python-astroid/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.