Fix Py2.7 build errors

This commit is contained in:
Steven Silvester
2014-12-24 06:54:56 -06:00
parent 4453120d96
commit d37ccca598
4 changed files with 7 additions and 8 deletions
+1 -2
View File
@@ -190,8 +190,7 @@ def setup_test():
from scipy.io import loadmat
from skimage import viewer, filter
np.random.seed(0)
if os.environ.get('TRAVIS_PYTHON_VERSION', None) != '2.7':
warnings.simplefilter('error')
warnings.simplefilter('error')
def teardown_test():
+1 -1
View File
@@ -211,7 +211,7 @@ def test_adapthist_grayscale():
img = skimage.img_as_float(data.astronaut())
img = rgb2gray(img)
img = np.dstack((img, img, img))
with expected_warnings(['precision loss']):
with expected_warnings(['precision loss|non-contiguous input]):
adapted = exposure.equalize_adapthist(img, 10, 9, clip_limit=0.01,
nbins=128)
assert_almost_equal = np.testing.assert_almost_equal
+1 -1
View File
@@ -11,7 +11,7 @@ from skimage._shared._warnings import expected_warnings
def test_all():
with expected_warnings(['precision loss', 'non-integer']):
with expected_warnings(['precision loss', 'non-integer|\A\Z']):
check_all()
+4 -4
View File
@@ -172,10 +172,10 @@ def test_3d_fallback_white_tophat():
image[3, 2:5, 2:5] = 1
image[4, 3:5, 3:5] = 1
with expected_warnings(['operator.*deprecated']):
with expected_warnings(['operator.*deprecated|\A\Z']):
new_image = grey.white_tophat(image)
footprint = ndimage.generate_binary_structure(3,1)
with expected_warnings(['operator.*deprecated']):
with expected_warnings(['operator.*deprecated\A\Z']):
image_expected = ndimage.white_tophat(image,footprint=footprint)
testing.assert_array_equal(new_image, image_expected)
@@ -185,10 +185,10 @@ def test_3d_fallback_black_tophat():
image[3, 2:5, 2:5] = 0
image[4, 3:5, 3:5] = 0
with expected_warnings(['operator.*deprecated']):
with expected_warnings(['operator.*deprecated|\A\Z']):
new_image = grey.black_tophat(image)
footprint = ndimage.generate_binary_structure(3,1)
with expected_warnings(['operator.*deprecated']):
with expected_warnings(['operator.*deprecated|\A\Z']):
image_expected = ndimage.black_tophat(image,footprint=footprint)
testing.assert_array_equal(new_image, image_expected)