Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

tests: test_image_files closes the file it reads, so its ResourceWarning no longer lands in test_flamechart's captured stderr

Gathin234fb37fb01aeb
diff --git a/tests/test_image_files.py b/tests/test_image_files.py
index d548098ca..dd8c272ce 100644
--- a/tests/test_image_files.py
+++ b/tests/test_image_files.py
@@ -58,7 +58,8 @@ def why_not(path):
A truncated file is reported too: the formats all begin with their magic, so an image that does
not is either empty, damaged, or not an image at all.
"""
- head = Path(path).open("rb").read(HEAD)
+ with open(path, "rb") as f:
+ head = f.read(HEAD)
suffix = Path(path).suffix.lower()
if suffix == ".webp":
if head[:4] == b"RIFF" and head[8:12] == b"WEBP":