Skip to content

Adjust test tolerance to pass for me on OSX #6249

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

Merged
merged 4 commits into from
Apr 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import warnings
from matplotlib.cbook import IgnoredKeywordWarning

import sys
on_win = (sys.platform == 'win32')

# Note: Some test cases are run twice: once normally and once with labeled data
# These two must be defined in the same test function or need to have
Expand Down Expand Up @@ -2766,7 +2764,7 @@ def test_subplot_key_hash():
@image_comparison(baseline_images=['specgram_freqs',
'specgram_freqs_linear'],
remove_text=True, extensions=['png'],
tol=0.07 if on_win else 0.03)
tol=0.07)
def test_specgram_freqs():
'''test axes.specgram in default (psd) mode with sinusoidal stimuli'''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also remove on_win and the sys import as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

n = 10000
Expand Down Expand Up @@ -2867,7 +2865,7 @@ def test_specgram_noise():
@image_comparison(baseline_images=['specgram_magnitude_freqs',
'specgram_magnitude_freqs_linear'],
remove_text=True, extensions=['png'],
tol=0.07 if on_win else 0.03)
tol=0.07)
def test_specgram_magnitude_freqs():
'''test axes.specgram in magnitude mode with sinusoidal stimuli'''
n = 10000
Expand Down Expand Up @@ -2969,7 +2967,7 @@ def test_specgram_magnitude_noise():

@image_comparison(baseline_images=['specgram_angle_freqs'],
remove_text=True, extensions=['png'],
tol=0.007 if on_win else 0)
tol=0.007)
def test_specgram_angle_freqs():
'''test axes.specgram in angle mode with sinusoidal stimuli'''
n = 10000
Expand Down
5 changes: 1 addition & 4 deletions lib/matplotlib/tests/test_patheffects.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
import mock
from nose.tools import assert_equal

import sys
on_win = (sys.platform == 'win32')


@image_comparison(baseline_images=['patheffect1'], remove_text=True)
def test_patheffect1():
Expand Down Expand Up @@ -113,7 +110,7 @@ def test_SimplePatchShadow_offset():
assert_equal(pe._offset, (4, 5))


@image_comparison(baseline_images=['collection'], tol=0.013 if on_win else 0)
@image_comparison(baseline_images=['collection'], tol=0.015)
def test_collection():
x, y = np.meshgrid(np.linspace(0, 10, 150), np.linspace(-5, 5, 100))
data = np.sin(x) + np.cos(y)
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/tests/test_mplot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_text3d():
ax.set_zlabel('Z axis')


@image_comparison(baseline_images=['trisurf3d'], remove_text=True)
@image_comparison(baseline_images=['trisurf3d'], remove_text=True, tol=0.03)
def test_trisurf3d():
n_angles = 36
n_radii = 8
Expand Down