mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-13 02:20:51 +08:00
Fixed tests to use assertRaises as a function not a context manager
This commit is contained in:
@@ -94,19 +94,14 @@ class TestCanny(unittest.TestCase):
|
||||
def test_invalid_use_quantiles(self):
|
||||
image = img_as_float(data.camera()[::50,::50])
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
result = F.canny(image, use_quantiles=True,
|
||||
low_threshold=0.5, high_threshold=3.6)
|
||||
self.assertRaises(ValueError, F.canny, image, use_quantiles=True,
|
||||
low_threshold=0.5, high_threshold=3.6)
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
result = F.canny(image, use_quantiles=True,
|
||||
low_threshold=99, high_threshold=0.9)
|
||||
self.assertRaises(ValueError, F.canny, image, use_quantiles=True,
|
||||
low_threshold=-5, high_threshold=0.5)
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
result = F.canny(image, use_quantiles=True,
|
||||
low_threshold=-5, high_threshold=0.5)
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
result = F.canny(image, use_quantiles=True,
|
||||
low_threshold=0.5, high_threshold=-100)
|
||||
self.assertRaises(ValueError, F.canny, image, use_quantiles=True,
|
||||
low_threshold=99, high_threshold=0.9)
|
||||
|
||||
self.assertRaises(ValueError, F.canny, image, use_quantiles=True,
|
||||
low_threshold=0.5, high_threshold=-100)
|
||||
|
||||
Reference in New Issue
Block a user