mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a test class that doesn't inherit from TestCase (i.e. a mixin).
This commit is contained in:
commit
f99983dacb
3 changed files with 19 additions and 1 deletions
|
@ -61,7 +61,7 @@ def skip(reason):
|
|||
Unconditionally skip a test.
|
||||
"""
|
||||
def decorator(test_item):
|
||||
if not (isinstance(test_item, type) and issubclass(test_item, TestCase)):
|
||||
if not isinstance(test_item, type):
|
||||
@functools.wraps(test_item)
|
||||
def skip_wrapper(*args, **kwargs):
|
||||
raise SkipTest(reason)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue