Remove redundant parentheses

This commit is contained in:
Hugo 2018-10-02 11:55:28 +03:00
parent 619e5fde8d
commit d69ef6a529
11 changed files with 15 additions and 15 deletions

View File

@ -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):

View File

@ -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"

View File

@ -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,

View File

@ -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))

View File

@ -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):

View File

@ -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

View File

@ -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'))

View File

@ -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

View File

@ -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):

View File

@ -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)))

View File

@ -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: