MCPcopy Index your code
hub / github.com/ipython/ipython / skip

Function skip

IPython/testing/decorators.py:44–63  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

42# A version with the condition set to true, common case just to attach a message
43# to a skip decorator
44def 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
66def onlyif(condition: bool, msg: str) -> MarkDecorator:

Callers

nothing calls this directly

Calls 1

skipifFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…