diff --git a/Tests/helper.py b/Tests/helper.py index 030335745..d2bcbb7f9 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -110,7 +110,7 @@ class PillowTestCase(unittest.TestCase): try: url = test_image_results.upload(a, b) logger.error("Url for test images: %s" % url) - except Exception as msg: + except Exception: pass self.fail(msg or "got different content") diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 5b0b0c46b..58a3d38c5 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -415,7 +415,7 @@ class TestFileLibTiff(LibTiffTestCase): im = Image.open('Tests/images/multipage.tiff') frames = im.n_frames self.assertEqual(frames, 3) - for idx in range(frames): + for _ in range(frames): im.seek(0) # Should not raise ValueError: I/O operation on closed file im.load() diff --git a/Tests/test_image.py b/Tests/test_image.py index 715c588da..3d7e4dc4d 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -56,7 +56,7 @@ class TestImage(PillowTestCase): self.assertEqual(im.width, 1) self.assertEqual(im.height, 2) - with self.assertRaises(AttributeError) as e: + with self.assertRaises(AttributeError): im.size = (3, 4) def test_invalid_image(self): diff --git a/Tests/test_imagetk.py b/Tests/test_imagetk.py index aec7429ce..72ca91ca2 100644 --- a/Tests/test_imagetk.py +++ b/Tests/test_imagetk.py @@ -11,7 +11,7 @@ try: import Tkinter as tk dir(ImageTk) HAS_TK = True -except (OSError, ImportError) as v: +except (OSError, ImportError): # Skipped via setUp() HAS_TK = False