Merge pull request #51 from radarhere/rm-warning

Assert that warning is raised
This commit is contained in:
Hugo van Kemenade 2020-04-20 13:02:02 +03:00 committed by GitHub
commit 852e53e182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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