Skip to content

Commit

Permalink
Format with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jun 19, 2019
1 parent 1b99362 commit 488a017
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Tests/test_file_ico.py
Expand Up @@ -93,7 +93,7 @@ def test_draw_reloaded(self):
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)
Expand Down
3 changes: 2 additions & 1 deletion Tests/test_file_psd.py
Expand Up @@ -20,6 +20,7 @@ def test_unclosed_file(self):
def open():
im = Image.open(test_file)
im.load()

self.assert_warning(None, open)

def test_invalid_file(self):
Expand Down Expand Up @@ -72,7 +73,7 @@ def test_seek_eoferror(self):
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):
Expand Down
14 changes: 10 additions & 4 deletions Tests/test_image_mode.py
Expand Up @@ -25,10 +25,16 @@ def test_sanity(self):
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)
Expand Down
8 changes: 4 additions & 4 deletions Tests/test_imagefontctl.py
Expand Up @@ -102,15 +102,15 @@ def test_text_direction_rtl2(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_imagesequence.py
Expand Up @@ -32,7 +32,7 @@ def test_iterator(self):
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))
Expand Down

0 comments on commit 488a017

Please sign in to comment.