Format with Black

This commit is contained in:
Hugo 2019-06-19 09:30:10 +03:00
parent 1b99362f3d
commit 488a0170a3
5 changed files with 18 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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