diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index dbbe72afa..505d48c81 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -245,7 +245,7 @@ class TestFilePng(PillowTestCase): im = Image.open(TEST_PNG_FILE) im.load() - self.assertRaises(RuntimeError, lambda: im.verify()) + self.assertRaises(RuntimeError, im.verify) def test_roundtrip_dpi(self): # Check dpi roundtripping diff --git a/Tests/test_image_load.py b/Tests/test_image_load.py index b1fc73182..f9d92e13c 100644 --- a/Tests/test_image_load.py +++ b/Tests/test_image_load.py @@ -18,7 +18,7 @@ class TestImageLoad(PillowTestCase): def test_close(self): im = Image.open("Tests/images/hopper.gif") im.close() - self.assertRaises(ValueError, lambda: im.load()) + self.assertRaises(ValueError, im.load) self.assertRaises(ValueError, lambda: im.getpixel((0, 0))) def test_contextmanager(self): diff --git a/Tests/test_imagepalette.py b/Tests/test_imagepalette.py index e56c61390..a16b590ba 100644 --- a/Tests/test_imagepalette.py +++ b/Tests/test_imagepalette.py @@ -117,7 +117,7 @@ class TestImagePalette(PillowTestCase): palette = raw("RGB", list(range(256))*3) # Act / Assert - self.assertRaises(ValueError, lambda: palette.tobytes()) + self.assertRaises(ValueError, palette.tobytes) self.assertRaises(ValueError, lambda: palette.getcolor((1, 2, 3))) f = self.tempfile("temp.lut") self.assertRaises(ValueError, lambda: palette.save(f)) diff --git a/Tests/test_imagewin.py b/Tests/test_imagewin.py index 7cfd7fe5c..c32290e43 100644 --- a/Tests/test_imagewin.py +++ b/Tests/test_imagewin.py @@ -114,7 +114,7 @@ class TestImageWinDib(PillowTestCase): buffer = dib.tobytes() # Act/Assert - self.assert_warning(DeprecationWarning, lambda: dib.tostring()) + self.assert_warning(DeprecationWarning, dib.tostring) self.assert_warning(DeprecationWarning, lambda: dib.fromstring(buffer))