Skip to content

Improve pytest.approx on lists #28

Description

@bagage

When a pytest.approx with a list of values is failing, current pretty-print is not super readable compared to simple lists:

import pytest


def test_approx():
    assert pytest.approx([100, 100, 100], abs=1) == [90, 100, 110]


def test_ints():
    assert [100, 100, 100] == [90, 100, 110]

image

Since pytest-icdiff already supports approx on single value, do you think it is a doable improvement of printing list values on separate lines too?

And kudo for the plugin!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions