Remove the tifffile save tests from test_pil

This commit is contained in:
Steven Silvester
2015-10-06 20:18:16 -05:00
parent d7a648ad55
commit 1547ec39f3
-30
View File
@@ -234,35 +234,5 @@ def test_cmyk():
sim = ssim(refi, newi, dynamic_range=refi.max() - refi.min())
assert sim > 0.99
class TestSaveTIF:
def roundtrip(self, dtype, x, compress):
with temporary_file(suffix='.tif') as fname:
if dtype == np.bool:
expected = ['low contrast']
else:
expected = ['\A\Z']
with expected_warnings(expected):
if compress > 0:
imsave(fname, x, compress=compress)
else:
imsave(fname, x)
y = imread(fname)
assert_array_equal(x, y)
def test_imsave_roundtrip(self):
for shape in [(10, 10), (10, 10, 3), (10, 10, 4)]:
for dtype in (np.uint8, np.uint16, np.int16, np.float32,
np.float64, np.bool):
for compress in [0, 2]:
x = np.random.rand(*shape)
if not np.issubdtype(dtype, float) and \
not dtype == np.bool:
x = (x * np.iinfo(dtype).max).astype(dtype)
else:
x = x.astype(dtype)
yield self.roundtrip, dtype, x, compress
if __name__ == "__main__":
run_module_suite()