diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-04-03 22:32:38 +0200 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-04-03 16:11:09 -0700 |
| commit | 00f119f4c4f776e5e36e8ea99bb3ff865cc52c09 (patch) | |
| tree | d3fe1c0adeba70b7368be9a475cdfffda8785bc2 /tests/functional/qemu_test/decorators.py | |
| parent | 4412d713822b6a0d87efd428ae164e80618ca2d2 (diff) | |
| download | focaccia-qemu-00f119f4c4f776e5e36e8ea99bb3ff865cc52c09.tar.gz focaccia-qemu-00f119f4c4f776e5e36e8ea99bb3ff865cc52c09.zip | |
tests/functional: Add a decorator for skipping tests on particular OS
Since tests might be failing on some operating systems, introduce the skipIfOperatingSystem() decorator. Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250403203241.46692-3-philmd@linaro.org>
Diffstat (limited to 'tests/functional/qemu_test/decorators.py')
| -rw-r--r-- | tests/functional/qemu_test/decorators.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py index 1651eb739a..50d29de533 100644 --- a/tests/functional/qemu_test/decorators.py +++ b/tests/functional/qemu_test/decorators.py @@ -5,7 +5,7 @@ import importlib import os import platform -from unittest import skipUnless +from unittest import skipIf, skipUnless from .cmd import which @@ -28,6 +28,19 @@ def skipIfMissingCommands(*args): ''' Decorator to skip execution of a test if the current +host operating system does match one of the prohibited +ones. +Example + + @skipIfOperatingSystem("Linux", "Darwin") +''' +def skipIfOperatingSystem(*args): + return skipIf(platform.system() in args, + 'running on an OS (%s) that is not able to run this test' % + ", ".join(args)) + +''' +Decorator to skip execution of a test if the current host machine does not match one of the permitted machines. Example |