diff --git a/tests/ut/python/dataset/test_five_crop.py b/tests/ut/python/dataset/test_five_crop.py index 86f52bdcd7..84bb0624ba 100644 --- a/tests/ut/python/dataset/test_five_crop.py +++ b/tests/ut/python/dataset/test_five_crop.py @@ -86,12 +86,8 @@ def test_five_crop_error_msg(): transform = vision.ComposeOp(transforms) data = data.map(input_columns=["image"], operations=transform()) - with pytest.raises(RuntimeError) as info: + with pytest.raises(RuntimeError): data.create_tuple_iterator().__next__() - error_msg = "TypeError: img should be PIL Image or Numpy array. Got " - - # error msg comes from ToTensor() - assert error_msg in str(info.value) def test_five_crop_md5():