mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-28 13:54:41 +08:00
Update failing tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user