forked from OSchip/llvm-project
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. llvm-svn: 258048
This commit is contained in:
parent
239fda676c
commit
4da73573ab
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue