summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/test_result.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/test_result.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/test_result.py27
1 files changed, 11 insertions, 16 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/test_result.py b/lldb/packages/Python/lldbsuite/test/test_result.py
index b1749ebcc3e..9665d672a79 100644
--- a/lldb/packages/Python/lldbsuite/test/test_result.py
+++ b/lldb/packages/Python/lldbsuite/test/test_result.py
@@ -97,22 +97,17 @@ class LLDBTestResult(unittest2.TextTestResult):
else:
return str(test)
- def getCategoriesForTest(self,test):
- if hasattr(test,"_testMethodName"):
- test_method = getattr(test,"_testMethodName")
- test_method = getattr(test,test_method)
- else:
- test_method = None
- if test_method != None and hasattr(test_method,"getCategories"):
- test_categories = test_method.getCategories(test)
- elif hasattr(test,"getCategories"):
- test_categories = test.getCategories()
- elif inspect.ismethod(test) and test.__self__ != None and hasattr(test.__self__,"getCategories"):
- test_categories = test.__self__.getCategories()
- else:
- test_categories = []
- if test_categories == None:
- test_categories = []
+ def getCategoriesForTest(self, test):
+ """
+ Gets all the categories for the currently running test method in test case
+ """
+ test_categories = []
+ test_method = getattr(test, test._testMethodName)
+ if test_method != None and hasattr(test_method, "categories"):
+ test_categories.extend(test_method.categories)
+
+ test_categories.extend(test.getCategories())
+
return test_categories
def hardMarkAsSkipped(self,test):
OpenPOWER on IntegriCloud