Skip to content

Commit 24183d6

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cb4eb0d commit 24183d6

File tree

111 files changed

+8
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+8
-298
lines changed

Tests/check_fli_overflow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
def test_fli_overflow():
7-
87
# this should not crash with a malloc error or access violation
98
with Image.open(TEST_FILE) as im:
109
im.load()

Tests/check_png_dos.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def test_ignore_dos_text():
2323

2424

2525
def test_dos_text():
26-
2726
try:
2827
im = Image.open(TEST_FILE)
2928
im.load()

Tests/test_bmp_reference.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def test_bad():
1818
"""These shouldn't crash/dos, but they shouldn't return anything
1919
either"""
2020
for f in get_files("b"):
21-
2221
# Assert that there is no unclosed file warning
2322
with warnings.catch_warnings():
2423
try:

Tests/test_file_bmp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def test_rgba_bitfields():
141141
# This test image has been manually hexedited
142142
# to change the bitfield compression in the header from XBGR to RGBA
143143
with Image.open("Tests/images/rgb32bf-rgba.bmp") as im:
144-
145144
# So before the comparing the image, swap the channels
146145
b, g, r = im.split()[1:]
147146
im = Image.merge("RGB", (r, g, b))

Tests/test_file_bufrstub.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
def test_open():
1111
# Act
1212
with Image.open(TEST_FILE) as im:
13-
1413
# Assert
1514
assert im.format == "BUFR"
1615

@@ -31,7 +30,6 @@ def test_invalid_file():
3130
def test_load():
3231
# Arrange
3332
with Image.open(TEST_FILE) as im:
34-
3533
# Act / Assert: stub cannot load without an implemented handler
3634
with pytest.raises(OSError):
3735
im.load()

Tests/test_file_dcx.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def test_sanity():
1515

1616
# Act
1717
with Image.open(TEST_FILE) as im:
18-
1918
# Assert
2019
assert im.size == (128, 128)
2120
assert isinstance(im, DcxImagePlugin.DcxImageFile)
@@ -54,7 +53,6 @@ def test_invalid_file():
5453
def test_tell():
5554
# Arrange
5655
with Image.open(TEST_FILE) as im:
57-
5856
# Act
5957
frame = im.tell()
6058

Tests/test_file_eps.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def test_invalid_file():
8080
@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
8181
def test_cmyk():
8282
with Image.open("Tests/images/pil_sample_cmyk.eps") as cmyk_image:
83-
8483
assert cmyk_image.mode == "CMYK"
8584
assert cmyk_image.size == (100, 100)
8685
assert cmyk_image.format == "EPS"

Tests/test_file_fits.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
def test_open():
1313
# Act
1414
with Image.open(TEST_FILE) as im:
15-
1615
# Assert
1716
assert im.format == "FITS"
1817
assert im.size == (128, 128)

Tests/test_file_fli.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def test_context_manager():
6464
def test_tell():
6565
# Arrange
6666
with Image.open(static_test_file) as im:
67-
6867
# Act
6968
frame = im.tell()
7069

@@ -110,7 +109,6 @@ def test_eoferror():
110109

111110
def test_seek_tell():
112111
with Image.open(animated_test_file) as im:
113-
114112
layer_number = im.tell()
115113
assert layer_number == 0
116114

Tests/test_file_gif.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def test_optimize_if_palette_can_be_reduced_by_half():
209209
im = im.resize((591, 443))
210210
im_rgb = im.convert("RGB")
211211

212-
for (optimize, colors) in ((False, 256), (True, 8)):
212+
for optimize, colors in ((False, 256), (True, 8)):
213213
out = BytesIO()
214214
im_rgb.save(out, "GIF", optimize=optimize)
215215
with Image.open(out) as reloaded:
@@ -221,7 +221,6 @@ def test_roundtrip(tmp_path):
221221
im = hopper()
222222
im.save(out)
223223
with Image.open(out) as reread:
224-
225224
assert_image_similar(reread.convert("RGB"), im, 50)
226225

227226

@@ -232,7 +231,6 @@ def test_roundtrip2(tmp_path):
232231
im2 = im.copy()
233232
im2.save(out)
234233
with Image.open(out) as reread:
235-
236234
assert_image_similar(reread.convert("RGB"), hopper(), 50)
237235

238236

@@ -242,7 +240,6 @@ def test_roundtrip_save_all(tmp_path):
242240
im = hopper()
243241
im.save(out, save_all=True)
244242
with Image.open(out) as reread:
245-
246243
assert_image_similar(reread.convert("RGB"), im, 50)
247244

248245
# Multiframe image
@@ -284,13 +281,11 @@ def test_headers_saving_for_animated_gifs(tmp_path):
284281
important_headers = ["background", "version", "duration", "loop"]
285282
# Multiframe image
286283
with Image.open("Tests/images/dispose_bgnd.gif") as im:
287-
288284
info = im.info.copy()
289285

290286
out = str(tmp_path / "temp.gif")
291287
im.save(out, save_all=True)
292288
with Image.open(out) as reread:
293-
294289
for header in important_headers:
295290
assert info[header] == reread.info[header]
296291

@@ -308,7 +303,6 @@ def test_palette_handling(tmp_path):
308303
im2.save(f, optimize=True)
309304

310305
with Image.open(f) as reloaded:
311-
312306
assert_image_similar(im, reloaded.convert("RGB"), 10)
313307

314308

@@ -324,7 +318,6 @@ def roundtrip(im, *args, **kwargs):
324318

325319
orig = "Tests/images/test.colors.gif"
326320
with Image.open(orig) as im:
327-
328321
with roundtrip(im) as reloaded:
329322
assert_image_similar(im, reloaded, 1)
330323
with roundtrip(im, optimize=True) as reloaded:
@@ -575,7 +568,6 @@ def test_save_dispose(tmp_path):
575568
)
576569

577570
with Image.open(out) as img:
578-
579571
for i in range(2):
580572
img.seek(img.tell() + 1)
581573
assert img.disposal_method == i + 1
@@ -773,7 +765,6 @@ def test_multiple_duration(tmp_path):
773765
out, save_all=True, append_images=im_list[1:], duration=duration_list
774766
)
775767
with Image.open(out) as reread:
776-
777768
for duration in duration_list:
778769
assert reread.info["duration"] == duration
779770
try:
@@ -786,7 +777,6 @@ def test_multiple_duration(tmp_path):
786777
out, save_all=True, append_images=im_list[1:], duration=tuple(duration_list)
787778
)
788779
with Image.open(out) as reread:
789-
790780
for duration in duration_list:
791781
assert reread.info["duration"] == duration
792782
try:
@@ -844,7 +834,6 @@ def test_identical_frames(tmp_path):
844834
out, save_all=True, append_images=im_list[1:], duration=duration_list
845835
)
846836
with Image.open(out) as reread:
847-
848837
# Assert that the first three frames were combined
849838
assert reread.n_frames == 2
850839

0 commit comments

Comments
 (0)