Update failing tests

This commit is contained in:
Steven Silvester
2015-12-12 14:20:38 -06:00
parent f8d19ae7f0
commit a6f4419da4
2 changed files with 8 additions and 6 deletions
+1 -2
View File
@@ -87,8 +87,7 @@ def test_outside_standard_range():
def test_nonstandard_type():
plt.figure()
with expected_warnings(["Non-standard image type",
"Low image dynamic range"]):
with expected_warnings(["Low image dynamic range"]):
ax_im = io.imshow(im64)
assert ax_im.get_clim() == (im64.min(), im64.max())
assert n_subplots(ax_im) == 2
+7 -4
View File
@@ -29,7 +29,7 @@ def test_range():
(img_as_float, np.float64),
(img_as_uint, np.uint16),
(img_as_ubyte, np.ubyte)]:
with expected_warnings(['precision loss|sign loss|\A\Z']):
y = f(x)
@@ -62,7 +62,7 @@ def test_range_extra_dtypes():
for dtype_in, dt in dtype_pairs:
imin, imax = dtype_range_extra[dtype_in]
x = np.linspace(imin, imax, 10).astype(dtype_in)
with expected_warnings(['precision loss|sign loss|\A\Z']):
y = convert(x, dt)
@@ -72,9 +72,12 @@ def test_range_extra_dtypes():
y, omin, omax, np.dtype(dt))
def test_unsupported_dtype():
def test_downcast():
x = np.arange(10).astype(np.uint64)
assert_raises(ValueError, img_as_int, x)
with expected_warnings('Downcasting'):
y = img_as_int(x)
assert np.allclose(y, x.astype(np.int16))
assert y.dtype == np.uint16
def test_float_out_of_range():