summary refs log tree commit diff stats
path: root/tests/functional/qemu_test/decorators.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/qemu_test/decorators.py')
-rw-r--r--tests/functional/qemu_test/decorators.py15
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