mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-30 20:36:44 +08:00
Update multi_image test and install tifffile for travis.
This commit is contained in:
committed by
Stefan van der Walt
parent
e0e4fe26f1
commit
0134946fc7
@@ -1,19 +1,11 @@
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
from numpy.testing.decorators import skipif
|
||||
from numpy.testing import assert_raises, assert_equal, assert_allclose
|
||||
|
||||
from skimage import data_dir
|
||||
from skimage.io.collection import MultiImage
|
||||
|
||||
try:
|
||||
from PIL import Image
|
||||
except ImportError:
|
||||
PIL_available = False
|
||||
else:
|
||||
PIL_available = True
|
||||
|
||||
import six
|
||||
|
||||
|
||||
@@ -22,14 +14,11 @@ class TestMultiImage():
|
||||
def setUp(self):
|
||||
# This multipage TIF file was created with imagemagick:
|
||||
# convert im1.tif im2.tif -adjoin multipage.tif
|
||||
if PIL_available:
|
||||
self.img = MultiImage(os.path.join(data_dir, 'multipage.tif'))
|
||||
self.img = MultiImage(os.path.join(data_dir, 'multipage.tif'))
|
||||
|
||||
@skipif(not PIL_available)
|
||||
def test_len(self):
|
||||
assert len(self.img) == 2
|
||||
|
||||
@skipif(not PIL_available)
|
||||
def test_getitem(self):
|
||||
num = len(self.img)
|
||||
for i in range(-num, num):
|
||||
@@ -42,7 +31,6 @@ class TestMultiImage():
|
||||
assert_raises(IndexError, return_img, num)
|
||||
assert_raises(IndexError, return_img, -num - 1)
|
||||
|
||||
@skipif(not PIL_available)
|
||||
def test_files_property(self):
|
||||
assert isinstance(self.img.filename, six.string_types)
|
||||
|
||||
@@ -50,7 +38,6 @@ class TestMultiImage():
|
||||
self.img.filename = f
|
||||
assert_raises(AttributeError, set_filename, 'newfile')
|
||||
|
||||
@skipif(not PIL_available)
|
||||
def test_conserve_memory_property(self):
|
||||
assert isinstance(self.img.conserve_memory, bool)
|
||||
|
||||
@@ -58,7 +45,6 @@ class TestMultiImage():
|
||||
self.img.conserve_memory = val
|
||||
assert_raises(AttributeError, set_mem, True)
|
||||
|
||||
@skipif(not PIL_available)
|
||||
def test_concatenate(self):
|
||||
array = self.img.concatenate()
|
||||
assert_equal(array.shape, (len(self.img),) + self.img[0].shape)
|
||||
|
||||
Reference in New Issue
Block a user