Skip to content

New recommended ways to write (in)equality assertions in tests #13180

@NicolasHug

Description

@NicolasHug

I've had a few reviews recommending the use of np.testing.assert_allclose() (or was it assert np.allclose()?) instead of assert_array_almost_equal but there doesn't seem to be a consensus (#13130 (comment)).

Also the use of assert_equal seems to be "deprecated" in favor of assert . == . (https://github.com/scikit-learn/scikit-learn/pull/13174/files#r257524501)

So, let's all agree on how we should write tests? I'll update the dev guide with the new decisions

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions