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


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to