mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-06 05:16:40 +08:00
Fix Py2.7 build errors
This commit is contained in:
@@ -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():
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user