summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 787525af5d2..9d0c4e2559f 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -601,15 +601,11 @@ def expectedFailure(expected_fn, bugnumber=None):
def wrapper(*args, **kwargs):
from unittest2 import case
self = args[0]
- try:
- func(*args, **kwargs)
- except Exception:
- if expected_fn(self):
- raise case._ExpectedFailure(sys.exc_info(), bugnumber)
- else:
- raise
if expected_fn(self):
- raise case._UnexpectedSuccess(sys.exc_info(), bugnumber)
+ xfail_func = unittest2.expectedFailure(func)
+ xfail_func(*args, **kwargs)
+ else:
+ func(*args, **kwargs)
return wrapper
# if bugnumber is not-callable(incluing None), that means decorator function is called with optional arguments
# return decorator in this case, so it will be used to decorating original method
OpenPOWER on IntegriCloud