mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Removed unnecessary lambdas
This commit is contained in:
parent
7f414057c9
commit
76fec69eda
|
@ -245,7 +245,7 @@ class TestFilePng(PillowTestCase):
|
||||||
|
|
||||||
im = Image.open(TEST_PNG_FILE)
|
im = Image.open(TEST_PNG_FILE)
|
||||||
im.load()
|
im.load()
|
||||||
self.assertRaises(RuntimeError, lambda: im.verify())
|
self.assertRaises(RuntimeError, im.verify)
|
||||||
|
|
||||||
def test_roundtrip_dpi(self):
|
def test_roundtrip_dpi(self):
|
||||||
# Check dpi roundtripping
|
# Check dpi roundtripping
|
||||||
|
|
|
@ -18,7 +18,7 @@ class TestImageLoad(PillowTestCase):
|
||||||
def test_close(self):
|
def test_close(self):
|
||||||
im = Image.open("Tests/images/hopper.gif")
|
im = Image.open("Tests/images/hopper.gif")
|
||||||
im.close()
|
im.close()
|
||||||
self.assertRaises(ValueError, lambda: im.load())
|
self.assertRaises(ValueError, im.load)
|
||||||
self.assertRaises(ValueError, lambda: im.getpixel((0, 0)))
|
self.assertRaises(ValueError, lambda: im.getpixel((0, 0)))
|
||||||
|
|
||||||
def test_contextmanager(self):
|
def test_contextmanager(self):
|
||||||
|
|
|
@ -117,7 +117,7 @@ class TestImagePalette(PillowTestCase):
|
||||||
palette = raw("RGB", list(range(256))*3)
|
palette = raw("RGB", list(range(256))*3)
|
||||||
|
|
||||||
# Act / Assert
|
# Act / Assert
|
||||||
self.assertRaises(ValueError, lambda: palette.tobytes())
|
self.assertRaises(ValueError, palette.tobytes)
|
||||||
self.assertRaises(ValueError, lambda: palette.getcolor((1, 2, 3)))
|
self.assertRaises(ValueError, lambda: palette.getcolor((1, 2, 3)))
|
||||||
f = self.tempfile("temp.lut")
|
f = self.tempfile("temp.lut")
|
||||||
self.assertRaises(ValueError, lambda: palette.save(f))
|
self.assertRaises(ValueError, lambda: palette.save(f))
|
||||||
|
|
|
@ -114,7 +114,7 @@ class TestImageWinDib(PillowTestCase):
|
||||||
buffer = dib.tobytes()
|
buffer = dib.tobytes()
|
||||||
|
|
||||||
# Act/Assert
|
# Act/Assert
|
||||||
self.assert_warning(DeprecationWarning, lambda: dib.tostring())
|
self.assert_warning(DeprecationWarning, dib.tostring)
|
||||||
self.assert_warning(DeprecationWarning, lambda: dib.fromstring(buffer))
|
self.assert_warning(DeprecationWarning, lambda: dib.fromstring(buffer))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user