diff options
| author | Daniel P. Berrangé <berrange@redhat.com> | 2024-12-17 15:59:29 +0000 |
|---|---|---|
| committer | Thomas Huth <thuth@redhat.com> | 2024-12-17 19:39:53 +0100 |
| commit | 3d5938607e05c4f8ac6df046a92fad19b681c23b (patch) | |
| tree | c161ecbdd2ca7805e69bf760965eececa415c0f7 /tests/functional/test_m68k_nextcube.py | |
| parent | 3ea06d65be5ee65beabc479d92e964e3c9df5080 (diff) | |
| download | focaccia-qemu-3d5938607e05c4f8ac6df046a92fad19b681c23b.tar.gz focaccia-qemu-3d5938607e05c4f8ac6df046a92fad19b681c23b.zip | |
tests/functional: switch to new test skip decorators
This ensures consistency of behaviour across all the tests, and requires that we provide gitlab bug links when marking a test to be skipped due to unreliability. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-9-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/functional/test_m68k_nextcube.py')
| -rwxr-xr-x | tests/functional/test_m68k_nextcube.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/tests/functional/test_m68k_nextcube.py b/tests/functional/test_m68k_nextcube.py index e6e8d4fd3f..25a17d4794 100755 --- a/tests/functional/test_m68k_nextcube.py +++ b/tests/functional/test_m68k_nextcube.py @@ -11,17 +11,9 @@ import os import time from qemu_test import QemuSystemTest, Asset -from unittest import skipUnless - -from qemu_test import has_cmd +from qemu_test import skipIfMissingImports, skipIfMissingCommands from qemu_test.tesseract import tesseract_ocr -PIL_AVAILABLE = True -try: - from PIL import Image -except ImportError: - PIL_AVAILABLE = False - class NextCubeMachine(QemuSystemTest): @@ -44,17 +36,18 @@ class NextCubeMachine(QemuSystemTest): self.vm.cmd('human-monitor-command', command_line='screendump %s' % screenshot_path) - @skipUnless(PIL_AVAILABLE, 'Python PIL not installed') + @skipIfMissingImports("PIL") def test_bootrom_framebuffer_size(self): self.set_machine('next-cube') screenshot_path = os.path.join(self.workdir, "dump.ppm") self.check_bootrom_framebuffer(screenshot_path) + from PIL import Image width, height = Image.open(screenshot_path).size self.assertEqual(width, 1120) self.assertEqual(height, 832) - @skipUnless(*has_cmd('tesseract')) + @skipIfMissingCommands('tesseract') def test_bootrom_framebuffer_ocr_with_tesseract(self): self.set_machine('next-cube') screenshot_path = os.path.join(self.workdir, "dump.ppm") |