Narrow Image type for bit_depth assertions to fix mypy

This commit is contained in:
AJ Slater 2026-05-01 15:22:31 -07:00
parent a7b2a65f7b
commit eddbdd254d

View File

@ -233,6 +233,7 @@ class TestFilePng:
)
def test_bit_depth(self, test_file: str, expected_bit_depth: int) -> None:
with Image.open(test_file) as im:
assert isinstance(im, PngImagePlugin.PngImageFile)
assert im.bit_depth == expected_bit_depth
def test_load_transparent_p(self) -> None: