aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2025-08-29 16:20:00 +0200
committerThomas Huth <thuth@redhat.com>2025-09-09 09:44:46 +0200
commit5f81033e5b3e55eda2a1d06f959c05b61e719d68 (patch)
tree06e4386ca4b0e0c2ce0d0c080d16c3bd78594489
parent38dd513263d814dc3cf554b899c118a46ca77577 (diff)
downloadqemu-5f81033e5b3e55eda2a1d06f959c05b61e719d68.zip
qemu-5f81033e5b3e55eda2a1d06f959c05b61e719d68.tar.gz
qemu-5f81033e5b3e55eda2a1d06f959c05b61e719d68.tar.bz2
tests/functional/m68k: Avoid ResourceWarning in the nextcube test
Since commit c3fd296cf7b1 ("functional: always enable all python warnings") we enabled more warnings for the functional tests. This triggers now a warning in the nextcube test: tests/functional/m68k/test_nextcube.py:47: ResourceWarning: unclosed file <_io.BufferedReader name='tests/functional/m68k/test_nextcube.NextCubeMachine.test_bootrom_framebuffer_size/scratch/dump.ppm'> width, height = Image.open(screenshot_path).size Use a proper "with" context to avoid it. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250829142000.62320-1-thuth@redhat.com>
-rwxr-xr-xtests/functional/m68k/test_nextcube.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/functional/m68k/test_nextcube.py b/tests/functional/m68k/test_nextcube.py
index 13c72bd..c1610e5 100755
--- a/tests/functional/m68k/test_nextcube.py
+++ b/tests/functional/m68k/test_nextcube.py
@@ -44,7 +44,8 @@ class NextCubeMachine(QemuSystemTest):
self.check_bootrom_framebuffer(screenshot_path)
from PIL import Image
- width, height = Image.open(screenshot_path).size
+ with Image.open(screenshot_path) as image:
+ width, height = image.size
self.assertEqual(width, 1120)
self.assertEqual(height, 832)