[Lldb-commits] [lldb] [lldb][test] Switch LLDB API tests from vendored unittest2 to unittest (PR #79945)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 30 05:48:50 PST 2024


================
@@ -130,14 +130,14 @@ def expectedFailure_impl(func):
 
 def expectedFailureIfFn(expected_fn, bugnumber=None):
     def expectedFailure_impl(func):
-        if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+        if isinstance(func, type) and issubclass(func, unittest.TestCase):
             raise Exception("Decorator can only be used to decorate a test method")
 
         @wraps(func)
         def wrapper(*args, **kwargs):
             xfail_reason = expected_fn(*args, **kwargs)
             if xfail_reason is not None:
-                xfail_func = unittest2.expectedFailure(func)
+                xfail_func = unittest.expectedFailure(func)
----------------
DavidSpickett wrote:

I think there's something wrong here. With this PR, the tests in `lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py` don't xfail, they just fail.

But I presume that `expectedFailureIf` is working, so perhaps it's this extra wrapper layer doing something different and the behaviour of `expectedFailure` has changed since.

https://github.com/llvm/llvm-project/pull/79945


More information about the lldb-commits mailing list