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

Function onlyif

IPython/testing/decorators.py:254–262  ·  view source on GitHub ↗

The reverse from skipif, see skipif for details.

(condition, msg)

Source from the content-addressed store, hash-verified

252
253
254def onlyif(condition, msg):
255 """The reverse from skipif, see skipif for details."""
256
257 if callable(condition):
258 skip_condition = lambda : not condition()
259 else:
260 skip_condition = lambda : not condition
261
262 return skipif(skip_condition, msg)
263
264#-----------------------------------------------------------------------------
265# Utility functions for decorators

Callers 1

decorators.pyFile · 0.85

Calls 1

skipifFunction · 0.70

Tested by

no test coverage detected