matplotlib/pytest-mpl

Parametrized test tolerances

QuLogic opened this issue · 1 comments

Sometimes only one or two images need an increased tolerance, but we can only increase tolerance on the entire test set.

I'm not sure how best to indicate it. Maybe by using a marker on one of the parameters.

I'm not sure I understand what you are trying to do. Tolerance is configured on a per test basis, so increasing the tolerance of specific tests should be supported:

@pytest.mark.mpl_image_compare(tolerance=20)
def test_plot():
    ...

Maybe you are referring to a specific project's pytest.mark.mpl_image_compare wrapper (example) which has a fixed tolerance for all tests?