Skip to content

Commit 624848f

Browse files
committed
Do not repeatedly save to the same path
1 parent 2d1d801 commit 624848f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/test_file_jpeg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,10 @@ def test_truncated_jpeg_throws_oserror(self) -> None:
543543
)
544544
def test_qtables(self, tmp_path: Path) -> None:
545545
def _n_qtables_helper(n: int, test_file: str) -> None:
546+
b = BytesIO()
546547
with Image.open(test_file) as im:
547-
f = str(tmp_path / "temp.jpg")
548-
im.save(f, qtables=[[n] * 64] * n)
549-
with Image.open(f) as im:
548+
im.save(b, "JPEG", qtables=[[n] * 64] * n)
549+
with Image.open(b) as im:
550550
assert len(im.quantization) == n
551551
reloaded = self.roundtrip(im, qtables="keep")
552552
assert im.quantization == reloaded.quantization

0 commit comments

Comments
 (0)