From a0641b87c27bf3b24b531e393b8d2621f351b26d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 20 Apr 2020 19:27:09 +1000 Subject: [PATCH] Assert that warning is raised --- Tests/test_imagefile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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):