From e924cfd181258f3201a91f276283ab83939a6744 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 2 Jan 2026 21:32:22 +1100 Subject: [PATCH] Fix unclosed file warning --- Tests/test_imagemorph.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/test_imagemorph.py b/Tests/test_imagemorph.py index daba30015..aa8356b0b 100644 --- a/Tests/test_imagemorph.py +++ b/Tests/test_imagemorph.py @@ -231,15 +231,15 @@ def test_negate() -> None: def test_incorrect_mode() -> None: - im = hopper() mop = ImageMorph.MorphOp(op_name="erosion8") - with pytest.raises(ValueError, match="Image mode must be 1 or L"): - mop.apply(im) - with pytest.raises(ValueError, match="Image mode must be 1 or L"): - mop.match(im) - with pytest.raises(ValueError, match="Image mode must be 1 or L"): - mop.get_on_pixels(im) + with hopper() as im: + with pytest.raises(ValueError, match="Image mode must be 1 or L"): + mop.apply(im) + with pytest.raises(ValueError, match="Image mode must be 1 or L"): + mop.match(im) + with pytest.raises(ValueError, match="Image mode must be 1 or L"): + mop.get_on_pixels(im) def test_add_patterns() -> None: