Skip to content

Commit 00ec73d

Browse files
authored
Fix unclosed file warning (#9371)
2 parents 4337139 + e924cfd commit 00ec73d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Tests/test_imagemorph.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ def test_negate() -> None:
231231

232232

233233
def test_incorrect_mode() -> None:
234-
im = hopper()
235234
mop = ImageMorph.MorphOp(op_name="erosion8")
236235

237-
with pytest.raises(ValueError, match="Image mode must be 1 or L"):
238-
mop.apply(im)
239-
with pytest.raises(ValueError, match="Image mode must be 1 or L"):
240-
mop.match(im)
241-
with pytest.raises(ValueError, match="Image mode must be 1 or L"):
242-
mop.get_on_pixels(im)
236+
with hopper() as im:
237+
with pytest.raises(ValueError, match="Image mode must be 1 or L"):
238+
mop.apply(im)
239+
with pytest.raises(ValueError, match="Image mode must be 1 or L"):
240+
mop.match(im)
241+
with pytest.raises(ValueError, match="Image mode must be 1 or L"):
242+
mop.get_on_pixels(im)
243243

244244

245245
def test_add_patterns() -> None:

0 commit comments

Comments
 (0)