MCPcopy Create free account
hub / github.com/ipython/ipython / skip

Function skip

IPython/testing/decorators.py:234–251  ·  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=None)

Source from the content-addressed store, hash-verified

232# A version with the condition set to true, common case just to attach a message
233# to a skip decorator
234def 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
254def onlyif(condition, msg):

Callers 2

onlyif_cmds_existFunction · 0.85
onlyif_any_cmd_existsFunction · 0.85

Calls 1

skipifFunction · 0.70

Tested by

no test coverage detected