Skip to content

Improve pytest.approx on lists #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bagage opened this issue Oct 18, 2022 · 0 comments
Open

Improve pytest.approx on lists #28

bagage opened this issue Oct 18, 2022 · 0 comments

Comments

@bagage
Copy link

bagage commented Oct 18, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant