diff --git a/test/test_image.py b/test/test_image.py index f9e88e8ad2f..048f7c364b1 100644 --- a/test/test_image.py +++ b/test/test_image.py @@ -158,7 +158,7 @@ def test_decode_png(img_path, pil_mode, mode): img_pil = normalize_dimensions(img_pil) - if "16" in img_path: + if img_path.endswith("16.png"): # 16 bits image decoding is supported, but only as a private API # FIXME: see https://github.com/pytorch/vision/issues/4731 for potential solutions to making it public with pytest.raises(RuntimeError, match="At most 8-bit PNG images are supported"):