Skip to content

Commit

Permalink
Slightly relax pytest threshold for selected images
Browse files Browse the repository at this point in the history
Images that failed pytest thresholds had only a few
pixels of difference, which is fine for users.

Signed-off-by: Christopher Holmes <[email protected]>
  • Loading branch information
cdholmes authored and dcamron committed Jan 6, 2025
1 parent 6e2b77a commit 27a49a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/plots/test_emagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_emagram_api_units():
return fig


@pytest.mark.mpl_image_compare(tolerance=0., remove_text=True, style='default')
@pytest.mark.mpl_image_compare(tolerance=0.001, remove_text=True, style='default')
def test_emagram_default_aspect_empty():
"""Test Emagram with default aspect and no plots, only special lines."""
# With this rotation and the default aspect, this matches exactly the NWS Emagram PDF
Expand All @@ -80,7 +80,7 @@ def test_emagram_default_aspect_empty():
return fig


@pytest.mark.mpl_image_compare(tolerance=0., remove_text=True, style='default')
@pytest.mark.mpl_image_compare(tolerance=0.001, remove_text=True, style='default')
def test_emagram_mixing_line_args():
"""Test plot_mixing_lines accepting kwargs for mixing ratio and pressure levels."""
# Explicitly pass default values as kwargs, should recreate NWS Emagram PDF as above
Expand Down
2 changes: 1 addition & 1 deletion tests/plots/test_stuve.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_stuve_api():
return fig


@pytest.mark.mpl_image_compare(remove_text=True, style='default', tolerance=0.32)
@pytest.mark.mpl_image_compare(remove_text=True, style='default', tolerance=0.35)
def test_stuve_api_units():
"""Test the Stuve API when units are provided."""
with matplotlib.rc_context({'axes.autolimit_mode': 'data'}):
Expand Down

0 comments on commit 27a49a3

Please sign in to comment.