pytest-icdiff icon indicating copy to clipboard operation
pytest-icdiff copied to clipboard

Improve pytest.approx on lists

Open bagage opened this issue 3 years ago • 0 comments

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!

bagage avatar Oct 18 '22 08:10 bagage