[Lldb-commits] [lldb] r258048 - Guard against application of an XFAIL decorator on a class

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 18 06:45:35 PST 2016


Author: labath
Date: Mon Jan 18 08:45:35 2016
New Revision: 258048

URL: http://llvm.org/viewvc/llvm-project?rev=258048&view=rev
Log:
Guard against application of an XFAIL decorator on a class

This does not work and causes the class to be silently skipped, which is a bad idea. This makes
sure it cannot happen accidentaly. I've played with the idea of actually making the decorator
work at class level, but it proved too magic to do at this moment.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=258048&r1=258047&r2=258048&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Jan 18 08:45:35 2016
@@ -593,6 +593,8 @@ def not_remote_testsuite_ready(func):
 
 def expectedFailure(expected_fn, bugnumber=None):
     def expectedFailure_impl(func):
+        if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+            raise Exception("Decorator can only be used to decorate a test method")
         @wraps(func)
         def wrapper(*args, **kwargs):
             from unittest2 import case




More information about the lldb-commits mailing list