diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py index 7719c7c71..6964d3e00 100644 --- a/Tests/test_imagefile.py +++ b/Tests/test_imagefile.py @@ -95,8 +95,9 @@ class TestImageFile: def test_raise_ioerror(self): with pytest.raises(IOError): - with pytest.warns(DeprecationWarning): + with pytest.warns(DeprecationWarning) as record: ImageFile.raise_ioerror(1) + assert len(record) == 1 def test_raise_oserror(self): with pytest.raises(OSError):