[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2022-10-13 02:22:49 +00:00
parent 69baeccf2e
commit c93413835d
2 changed files with 5 additions and 5 deletions

View File

@ -240,7 +240,7 @@ def test_header_token_too_long(tmp_path):
def test_truncated_file(tmp_path):
# Test EOF in header
path = str(tmp_path / "temp.pgm")
with open(path, "w", encoding='utf-8') as f:
with open(path, "w", encoding="utf-8") as f:
f.write("P6")
with pytest.raises(ValueError) as e:
@ -259,7 +259,7 @@ def test_truncated_file(tmp_path):
@pytest.mark.parametrize("maxval", (0, 65536))
def test_invalid_maxval(maxval, tmp_path):
path = str(tmp_path / "temp.ppm")
with open(path, "w", encoding='utf-8') as f:
with open(path, "w", encoding="utf-8") as f:
f.write("P6\n3 1 " + str(maxval))
with pytest.raises(ValueError) as e:
@ -283,12 +283,12 @@ def test_neg_ppm():
def test_mimetypes(tmp_path):
path = str(tmp_path / "temp.pgm")
with open(path, "w", encoding='utf-8') as f:
with open(path, "w", encoding="utf-8") as f:
f.write("P4\n128 128\n255")
with Image.open(path) as im:
assert im.get_format_mimetype() == "image/x-portable-bitmap"
with open(path, "w", encoding='utf-8') as f:
with open(path, "w", encoding="utf-8") as f:
f.write("PyCMYK\n128 128\n255")
with Image.open(path) as im:
assert im.get_format_mimetype() == "image/x-portable-anymap"

View File

@ -414,7 +414,7 @@ class TestEmbeddable:
def test_embeddable(self):
import ctypes
with open("embed_pil.c", "w", encoding='utf-8') as fh:
with open("embed_pil.c", "w", encoding="utf-8") as fh:
fh.write(
"""
#include "Python.h"