diff options
author | Pavel Labath <labath@google.com> | 2016-01-18 14:45:35 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-01-18 14:45:35 +0000 |
commit | 4da73573abb6834ff7a7748c8384bd25f5036b2f (patch) | |
tree | 2d9cea6ab9744f1f2a65be65fa991d79044fe882 /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
parent | 239fda676c0ae172cbdfb698810458ae36e76178 (diff) | |
download | bcm5719-llvm-4da73573abb6834ff7a7748c8384bd25f5036b2f.tar.gz bcm5719-llvm-4da73573abb6834ff7a7748c8384bd25f5036b2f.zip |
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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 |