From 488a0170a33d73dbba7cdc2d2417fc5fd6c97ce6 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 19 Jun 2019 09:30:10 +0300 Subject: [PATCH] Format with Black --- Tests/test_file_ico.py | 2 +- Tests/test_file_psd.py | 3 ++- Tests/test_image_mode.py | 14 ++++++++++---- Tests/test_imagefontctl.py | 8 ++++---- Tests/test_imagesequence.py | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Tests/test_file_ico.py b/Tests/test_file_ico.py index 4cf903694..8427e2bd7 100644 --- a/Tests/test_file_ico.py +++ b/Tests/test_file_ico.py @@ -93,7 +93,7 @@ class TestFileIco(PillowTestCase): outfile = self.tempfile("temp_saved_hopper_draw.ico") draw = ImageDraw.Draw(im) - draw.line((0, 0) + im.size, '#f00') + draw.line((0, 0) + im.size, "#f00") im.save(outfile) im = Image.open(outfile) diff --git a/Tests/test_file_psd.py b/Tests/test_file_psd.py index 9d4865071..45fc0ef71 100644 --- a/Tests/test_file_psd.py +++ b/Tests/test_file_psd.py @@ -20,6 +20,7 @@ class TestImagePsd(PillowTestCase): def open(): im = Image.open(test_file) im.load() + self.assert_warning(None, open) def test_invalid_file(self): @@ -72,7 +73,7 @@ class TestImagePsd(PillowTestCase): def test_open_after_exclusive_load(self): im = Image.open(test_file) im.load() - im.seek(im.tell()+1) + im.seek(im.tell() + 1) im.load() def test_icc_profile(self): diff --git a/Tests/test_image_mode.py b/Tests/test_image_mode.py index 325b0372e..e41a20e9b 100644 --- a/Tests/test_image_mode.py +++ b/Tests/test_image_mode.py @@ -25,10 +25,16 @@ class TestImageMode(PillowTestCase): self.assertEqual(m.basemode, "L") self.assertEqual(m.basetype, "L") - for mode in ("I;16", "I;16S", - "I;16L", "I;16LS", - "I;16B", "I;16BS", - "I;16N", "I;16NS"): + for mode in ( + "I;16", + "I;16S", + "I;16L", + "I;16LS", + "I;16B", + "I;16BS", + "I;16N", + "I;16NS", + ): m = ImageMode.getmode(mode) self.assertEqual(m.mode, mode) self.assertEqual(str(m), mode) diff --git a/Tests/test_imagefontctl.py b/Tests/test_imagefontctl.py index f34dba4bb..25460be15 100644 --- a/Tests/test_imagefontctl.py +++ b/Tests/test_imagefontctl.py @@ -102,15 +102,15 @@ class TestImagecomplextext(PillowTestCase): def test_text_direction_ttb(self): ttf = ImageFont.truetype("Tests/fonts/NotoSansJP-Regular.otf", FONT_SIZE) - im = Image.new(mode='RGB', size=(100, 300)) + im = Image.new(mode="RGB", size=(100, 300)) draw = ImageDraw.Draw(im) try: - draw.text((0, 0), 'English あい', font=ttf, fill=500, direction='ttb') + draw.text((0, 0), "English あい", font=ttf, fill=500, direction="ttb") except ValueError as ex: if str(ex) == "libraqm 0.7 or greater required for 'ttb' direction": - self.skipTest('libraqm 0.7 or greater not available') + self.skipTest("libraqm 0.7 or greater not available") - target = 'Tests/images/test_direction_ttb.png' + target = "Tests/images/test_direction_ttb.png" target_img = Image.open(target) self.assert_image_similar(im, target_img, 1.15) diff --git a/Tests/test_imagesequence.py b/Tests/test_imagesequence.py index c028f140d..38645f133 100644 --- a/Tests/test_imagesequence.py +++ b/Tests/test_imagesequence.py @@ -32,7 +32,7 @@ class TestImageSequence(PillowTestCase): self.assertRaises(StopIteration, next, i) def test_iterator_min_frame(self): - im = Image.open('Tests/images/hopper.psd') + im = Image.open("Tests/images/hopper.psd") i = ImageSequence.Iterator(im) for index in range(1, im.n_frames): self.assertEqual(i[index], next(i))