hjwp/pytest-icdiff

Improve pytest.approx on lists

Opened this issue · 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!