Unconditionally skip a test.
(reason)
| 160 | |
| 161 | |
| 162 | def skip(reason): |
| 163 | """ |
| 164 | Unconditionally skip a test. |
| 165 | """ |
| 166 | def decorator(test_item): |
| 167 | if not isinstance(test_item, type): |
| 168 | @functools.wraps(test_item) |
| 169 | def skip_wrapper(*args, **kwargs): |
| 170 | raise SkipTest(reason) |
| 171 | test_item = skip_wrapper |
| 172 | |
| 173 | test_item.__unittest_skip__ = True |
| 174 | test_item.__unittest_skip_why__ = reason |
| 175 | return test_item |
| 176 | if isinstance(reason, types.FunctionType): |
| 177 | test_item = reason |
| 178 | reason = '' |
| 179 | return decorator(test_item) |
| 180 | return decorator |
| 181 | |
| 182 | def skipIf(condition, reason): |
| 183 | """ |
no test coverage detected