Decorator factory - mark a test function for skipping from test suite. Parameters ---------- msg : string Optional message to be added. Returns ------- decorator : function Decorator, which, when applied to a function, causes SkipTest to be ra
(msg=None)
| 232 | # A version with the condition set to true, common case just to attach a message |
| 233 | # to a skip decorator |
| 234 | def skip(msg=None): |
| 235 | """Decorator factory - mark a test function for skipping from test suite. |
| 236 | |
| 237 | Parameters |
| 238 | ---------- |
| 239 | msg : string |
| 240 | Optional message to be added. |
| 241 | |
| 242 | Returns |
| 243 | ------- |
| 244 | decorator : function |
| 245 | Decorator, which, when applied to a function, causes SkipTest |
| 246 | to be raised, with the optional message added. |
| 247 | """ |
| 248 | if msg and not isinstance(msg, str): |
| 249 | raise ValueError('invalid object passed to `@skip` decorator, did you ' |
| 250 | 'meant `@skip()` with brackets ?') |
| 251 | return skipif(True, msg) |
| 252 | |
| 253 | |
| 254 | def onlyif(condition, msg): |
no test coverage detected