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: Optional[str]=None)
| 42 | # A version with the condition set to true, common case just to attach a message |
| 43 | # to a skip decorator |
| 44 | def skip(msg: Optional[str]=None) -> MarkDecorator: |
| 45 | """Decorator factory - mark a test function for skipping from test suite. |
| 46 | |
| 47 | Parameters |
| 48 | ---------- |
| 49 | msg : string |
| 50 | Optional message to be added. |
| 51 | |
| 52 | Returns |
| 53 | ------- |
| 54 | decorator : function |
| 55 | Decorator, which, when applied to a function, causes SkipTest |
| 56 | to be raised, with the optional message added. |
| 57 | """ |
| 58 | if msg and not isinstance(msg, str): |
| 59 | raise ValueError( |
| 60 | "invalid object passed to `@skip` decorator, did you " |
| 61 | "meant `@skip()` with brackets ?" |
| 62 | ) |
| 63 | return skipif(True, msg) |
| 64 | |
| 65 | |
| 66 | def onlyif(condition: bool, msg: str) -> MarkDecorator: |
nothing calls this directly
no test coverage detected
searching dependent graphs…