From 619e5fde8d1f78ce35e5811bf275fdafcd69b625 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 2 Oct 2018 11:44:43 +0300 Subject: [PATCH] Remove unused local variables --- Tests/helper.py | 1 - Tests/test_000_sanity.py | 12 ++++++------ Tests/test_file_png.py | 10 +++++----- Tests/test_file_tiff.py | 10 +++++----- Tests/test_imagefile.py | 4 ++-- Tests/test_qt_image_toqimage.py | 2 +- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Tests/helper.py b/Tests/helper.py index d2bcbb7f9..8905e4009 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -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") diff --git a/Tests/test_000_sanity.py b/Tests/test_000_sanity.py index 67aff8ecc..62a9b5870 100644 --- a/Tests/test_000_sanity.py +++ b/Tests/test_000_sanity.py @@ -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__': diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index e9dcd5203..c958c0b39 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -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" diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 96ad05933..b4a1221c4 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -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] diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py index c95611b08..8a8cdb64b 100644 --- a/Tests/test_imagefile.py +++ b/Tests/test_imagefile.py @@ -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) diff --git a/Tests/test_qt_image_toqimage.py b/Tests/test_qt_image_toqimage.py index 28871d201..b9d095cd9 100644 --- a/Tests/test_qt_image_toqimage.py +++ b/Tests/test_qt_image_toqimage.py @@ -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