From 4da73573abb6834ff7a7748c8384bd25f5036b2f Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 18 Jan 2016 14:45:35 +0000 Subject: 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 --- lldb/packages/Python/lldbsuite/test/lldbtest.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py') diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 3ea02277aa0..8a66cbe7726 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -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 -- cgit v1.2.3