From 091dfcd1e34862f27195f38c5b0892710c8890c2 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 21 Mar 2022 11:43:57 +0000 Subject: [PATCH] More robust check in tests for 16 bits images --- test/test_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"):