Skip to content

pytest.approx() incorrectly flags nested sequences as unequal #11945

Description

@polwel

Consider this:

>>> a = [(1.20000000000001,)]
>>> b = [(1.2,)]
>>> a == pytest.approx(b)
False

On the other hand:

>>> a[0] == pytest.approx(b[0])
True

So I am assuming it is thrown off by the nested sequences.

I am using pytest 8.0.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: approxrelated to pytest.approx function

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions