[DTS][Patch V1 3/4] framework/test_case: Add skip_unsupported decorator.

Ke Xu ke1.xu at intel.com
Wed Jul 12 21:31:25 CEST 2023


Add a new decorator for marking unsupported cases.

Signed-off-by: Ke Xu <ke1.xu at intel.com>
---
 framework/test_case.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/framework/test_case.py b/framework/test_case.py
index 68f89407..35342de0 100644
--- a/framework/test_case.py
+++ b/framework/test_case.py
@@ -628,3 +628,24 @@ def skip_unsupported_host_driver(drivers):
         return wrapper
 
     return decorator
+
+
+def skip_unsupported(do_skip: bool = True, reason: str = None):
+    """
+    Skip case which are not supported. This means a case may be supported in future or in other branches.
+    """
+
+    def decorator(func):
+        @wraps(func)
+        def wrapper(*args, **kwargs):
+            test_case = args[0]
+            if do_skip:
+                raise VerifySkip(
+                    "DPDK currently do not support this case"
+                    + (" for %s" % reason if reason else "")
+                )
+            return func(*args, **kwargs)
+
+        return wrapper
+
+    return decorator
-- 
2.34.1



More information about the dts mailing list