Assert that warning is raised

This commit is contained in:
Andrew Murray 2020-04-20 19:27:09 +10:00
parent 270bc4fc60
commit a0641b87c2

View File

@ -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):