Fix unclosed file warning (#9371)

This commit is contained in:
mergify[bot] 2026-01-02 12:33:25 +00:00 committed by GitHub
commit 00ec73dfd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -231,15 +231,15 @@ def test_negate() -> None:
def test_incorrect_mode() -> None: def test_incorrect_mode() -> None:
im = hopper()
mop = ImageMorph.MorphOp(op_name="erosion8") mop = ImageMorph.MorphOp(op_name="erosion8")
with pytest.raises(ValueError, match="Image mode must be 1 or L"): with hopper() as im:
mop.apply(im) with pytest.raises(ValueError, match="Image mode must be 1 or L"):
with pytest.raises(ValueError, match="Image mode must be 1 or L"): mop.apply(im)
mop.match(im) with pytest.raises(ValueError, match="Image mode must be 1 or L"):
with pytest.raises(ValueError, match="Image mode must be 1 or L"): mop.match(im)
mop.get_on_pixels(im) with pytest.raises(ValueError, match="Image mode must be 1 or L"):
mop.get_on_pixels(im)
def test_add_patterns() -> None: def test_add_patterns() -> None: