mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Remove unused local variables
This commit is contained in:
parent
bac99bd5ae
commit
619e5fde8d
|
@ -163,7 +163,6 @@ class PillowTestCase(unittest.TestCase):
|
|||
def assert_warning(self, warn_class, func, *args, **kwargs):
|
||||
import warnings
|
||||
|
||||
result = None
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
# Cause all warnings to always be triggered.
|
||||
warnings.simplefilter("always")
|
||||
|
|
|
@ -9,7 +9,7 @@ class TestSanity(PillowTestCase):
|
|||
def test_sanity(self):
|
||||
|
||||
# Make sure we have the binary extension
|
||||
im = PIL.Image.core.new("L", (100, 100))
|
||||
PIL.Image.core.new("L", (100, 100))
|
||||
|
||||
self.assertEqual(PIL.Image.VERSION[:3], '1.1')
|
||||
|
||||
|
@ -19,11 +19,11 @@ class TestSanity(PillowTestCase):
|
|||
self.assertEqual(len(im.tobytes()), 1300)
|
||||
|
||||
# Create images in all remaining major modes.
|
||||
im = PIL.Image.new("L", (100, 100))
|
||||
im = PIL.Image.new("P", (100, 100))
|
||||
im = PIL.Image.new("RGB", (100, 100))
|
||||
im = PIL.Image.new("I", (100, 100))
|
||||
im = PIL.Image.new("F", (100, 100))
|
||||
PIL.Image.new("L", (100, 100))
|
||||
PIL.Image.new("P", (100, 100))
|
||||
PIL.Image.new("RGB", (100, 100))
|
||||
PIL.Image.new("I", (100, 100))
|
||||
PIL.Image.new("F", (100, 100))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -82,19 +82,19 @@ class TestFilePng(PillowTestCase):
|
|||
self.assertEqual(im.format, "PNG")
|
||||
|
||||
hopper("1").save(test_file)
|
||||
im = Image.open(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
hopper("L").save(test_file)
|
||||
im = Image.open(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
hopper("P").save(test_file)
|
||||
im = Image.open(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
hopper("RGB").save(test_file)
|
||||
im = Image.open(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
hopper("I").save(test_file)
|
||||
im = Image.open(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
def test_invalid_file(self):
|
||||
invalid_file = "Tests/images/flower.jpg"
|
||||
|
|
|
@ -26,19 +26,19 @@ class TestFileTiff(PillowTestCase):
|
|||
self.assertEqual(im.format, "TIFF")
|
||||
|
||||
hopper("1").save(filename)
|
||||
im = Image.open(filename)
|
||||
Image.open(filename)
|
||||
|
||||
hopper("L").save(filename)
|
||||
im = Image.open(filename)
|
||||
Image.open(filename)
|
||||
|
||||
hopper("P").save(filename)
|
||||
im = Image.open(filename)
|
||||
Image.open(filename)
|
||||
|
||||
hopper("RGB").save(filename)
|
||||
im = Image.open(filename)
|
||||
Image.open(filename)
|
||||
|
||||
hopper("I").save(filename)
|
||||
im = Image.open(filename)
|
||||
Image.open(filename)
|
||||
|
||||
def test_mac_tiff(self):
|
||||
# Read RGBa images from macOS [@PIL136]
|
||||
|
|
|
@ -204,7 +204,7 @@ class TestPyDecoder(PillowTestCase):
|
|||
|
||||
im = MockImageFile(buf)
|
||||
im.tile = [("MOCK", (xoff, yoff, -10, yoff+ysize), 32, None)]
|
||||
d = self.get_decoder()
|
||||
self.get_decoder()
|
||||
|
||||
self.assertRaises(ValueError, im.load)
|
||||
|
||||
|
@ -218,7 +218,7 @@ class TestPyDecoder(PillowTestCase):
|
|||
im.tile = [
|
||||
("MOCK", (xoff, yoff, xoff+xsize + 100, yoff+ysize), 32, None)
|
||||
]
|
||||
d = self.get_decoder()
|
||||
self.get_decoder()
|
||||
|
||||
self.assertRaises(ValueError, im.load)
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ if ImageQt.qt_is_installed:
|
|||
|
||||
pixmap1 = QtGui.QPixmap.fromImage(qimage)
|
||||
|
||||
hbox = QHBoxLayout(self)
|
||||
QHBoxLayout(self)
|
||||
|
||||
lbl = QLabel(self)
|
||||
# Segfault in the problem
|
||||
|
|
Loading…
Reference in New Issue
Block a user