Skip to content

Support generic mapping in builtin assertrepr compare #14461

@DavideCanton

Description

@DavideCanton

What's the problem this feature will solve?

Having a nicely formatted assert when comparing mappings that are not subclass of dicts.

Describe the solution you'd like

I think it's enough to change the check in _compare_eq_any and similar that at the moment does isinstance(x, dict) to mapping, since it seems that _compare_eq_dict already supports mappings.

Alternative Solutions

At the moment, I just do assert dict(d1) == dict(d2)

Additional context

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