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

Function onlyif_any_cmd_exists

IPython/testing/decorators.py:373–383  ·  view source on GitHub ↗

Decorator to skip test unless at least one of `commands` is found.

(*commands)

Source from the content-addressed store, hash-verified

371 return null_deco
372
373def onlyif_any_cmd_exists(*commands):
374 """
375 Decorator to skip test unless at least one of `commands` is found.
376 """
377 warnings.warn("The function `onlyif_any_cmd_exists` is deprecated since IPython 4.0",
378 DeprecationWarning, stacklevel=2)
379 for cmd in commands:
380 if shutil.which(cmd):
381 return null_deco
382 return skip("This test runs only if one of the commands {0} "
383 "is installed".format(commands))

Callers

nothing calls this directly

Calls 3

skipFunction · 0.85
warnMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected