diff --git a/Tests/check_large_memory.py b/Tests/check_large_memory.py index ef0cd1f80..5c8dc10f7 100644 --- a/Tests/check_large_memory.py +++ b/Tests/check_large_memory.py @@ -21,7 +21,7 @@ class LargeMemoryTest(PillowTestCase): def _write_png(self, xdim, ydim): f = self.tempfile('temp.png') - im = Image.new('L', (xdim, ydim), (0)) + im = Image.new('L', (xdim, ydim), 0) im.save(f) def test_large(self): diff --git a/Tests/test_file_webp_lossless.py b/Tests/test_file_webp_lossless.py index 4c35dad73..4d9eff7f1 100644 --- a/Tests/test_file_webp_lossless.py +++ b/Tests/test_file_webp_lossless.py @@ -16,7 +16,7 @@ class TestFileWebpLossless(PillowTestCase): self.skipTest('WebP support not installed') return - if (_webp.WebPDecoderVersion() < 0x0200): + if _webp.WebPDecoderVersion() < 0x0200: self.skipTest('lossless not included') self.rgb_mode = "RGB" diff --git a/Tests/test_image.py b/Tests/test_image.py index 3d7e4dc4d..73f391734 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -286,9 +286,9 @@ class TestImage(PillowTestCase): source.alpha_composite, over, (0, 0), "invalid destination") self.assertRaises(ValueError, - source.alpha_composite, over, (0)) + source.alpha_composite, over, 0) self.assertRaises(ValueError, - source.alpha_composite, over, (0, 0), (0)) + source.alpha_composite, over, (0, 0), 0) self.assertRaises(ValueError, source.alpha_composite, over, (0, -1)) self.assertRaises(ValueError, diff --git a/Tests/test_image_getdata.py b/Tests/test_image_getdata.py index ef07844df..de502065b 100644 --- a/Tests/test_image_getdata.py +++ b/Tests/test_image_getdata.py @@ -23,7 +23,7 @@ class TestImageGetData(PillowTestCase): self.assertEqual(getdata("L"), (16, 960, 960)) self.assertEqual(getdata("I"), (16, 960, 960)) self.assertEqual(getdata("F"), (16.0, 960, 960)) - self.assertEqual(getdata("RGB"), (((11, 13, 52), 960, 960))) + self.assertEqual(getdata("RGB"), ((11, 13, 52), 960, 960)) self.assertEqual(getdata("RGBA"), ((11, 13, 52, 255), 960, 960)) self.assertEqual(getdata("CMYK"), ((244, 242, 203, 0), 960, 960)) self.assertEqual(getdata("YCbCr"), ((16, 147, 123), 960, 960)) diff --git a/Tests/test_image_getextrema.py b/Tests/test_image_getextrema.py index 9783141a3..f002419da 100644 --- a/Tests/test_image_getextrema.py +++ b/Tests/test_image_getextrema.py @@ -19,7 +19,7 @@ class TestImageGetExtrema(PillowTestCase): self.assertEqual( extrema("RGBA"), ((0, 255), (0, 255), (0, 255), (255, 255))) self.assertEqual( - extrema("CMYK"), (((0, 255), (0, 255), (0, 255), (0, 0)))) + extrema("CMYK"), ((0, 255), (0, 255), (0, 255), (0, 0))) self.assertEqual(extrema("I;16"), (0, 255)) def test_true_16(self): diff --git a/Tests/test_image_resample.py b/Tests/test_image_resample.py index 226e7873a..46a45833e 100644 --- a/Tests/test_image_resample.py +++ b/Tests/test_image_resample.py @@ -196,7 +196,7 @@ class TestImagingCoreResampleAccuracy(PillowTestCase): class CoreResampleConsistencyTest(PillowTestCase): def make_case(self, mode, fill): im = Image.new(mode, (512, 9), fill) - return (im.resize((9, 512), Image.LANCZOS), im.load()[0, 0]) + return im.resize((9, 512), Image.LANCZOS), im.load()[0, 0] def run_case(self, case): channel, color = case diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index bfc43b7b6..7f2accdcb 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -46,7 +46,7 @@ class TestImageDraw(PillowTestCase): im = Image.open("Tests/images/chi.gif") draw = ImageDraw.Draw(im) - draw.line(((0, 0)), fill=(0, 0, 0)) + draw.line((0, 0), fill=(0, 0, 0)) def test_mode_mismatch(self): im = hopper("RGB").copy() @@ -543,7 +543,7 @@ class TestImageDraw(PillowTestCase): for y in range(0, size[1]): if (x + y) % 2 == 0: img.putpixel((x, y), background2) - return (img, ImageDraw.Draw(img)) + return img, ImageDraw.Draw(img) def test_square(self): expected = Image.open(os.path.join(IMAGES_PATH, 'square.png')) diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py index 8a8cdb64b..4f81df12e 100644 --- a/Tests/test_imagefile.py +++ b/Tests/test_imagefile.py @@ -144,7 +144,7 @@ class TestImageFile(PillowTestCase): class MockPyDecoder(ImageFile.PyDecoder): def decode(self, buffer): # eof - return (-1, 0) + return -1, 0 xoff, yoff, xsize, ysize = 10, 20, 100, 100 diff --git a/Tests/test_imagetk.py b/Tests/test_imagetk.py index 72ca91ca2..667d18e8f 100644 --- a/Tests/test_imagetk.py +++ b/Tests/test_imagetk.py @@ -26,7 +26,7 @@ class TestImageTk(PillowTestCase): # setup tk tk.Frame() # root = tk.Tk() - except (tk.TclError) as v: + except tk.TclError as v: self.skipTest("TCL Error: %s" % v) def test_kw(self): diff --git a/Tests/test_lib_pack.py b/Tests/test_lib_pack.py index 6f755c239..33590eeb4 100644 --- a/Tests/test_lib_pack.py +++ b/Tests/test_lib_pack.py @@ -17,7 +17,7 @@ class TestLibPack(PillowTestCase): for x, pixel in enumerate(pixels): im.putpixel((x, 0), pixel) - if isinstance(data, (int)): + if isinstance(data, int): data_len = data * len(pixels) data = bytes(bytearray(range(1, data_len + 1))) @@ -217,7 +217,7 @@ class TestLibUnpack(PillowTestCase): """ data - either raw bytes with data or just number of bytes in rawmode. """ - if isinstance(data, (int)): + if isinstance(data, int): data_len = data * len(pixels) data = bytes(bytearray(range(1, data_len + 1))) diff --git a/Tests/test_qt_image_toqimage.py b/Tests/test_qt_image_toqimage.py index b9d095cd9..6f4a044e2 100644 --- a/Tests/test_qt_image_toqimage.py +++ b/Tests/test_qt_image_toqimage.py @@ -70,8 +70,8 @@ class TestToQImage(PillowQtTestCase, PillowTestCase): def test_segfault(self): app = QApplication([]) ex = Example() - assert(app) # Silence warning - assert(ex) # Silence warning + assert app # Silence warning + assert ex # Silence warning if ImageQt.qt_is_installed: