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

Function onlyif_cmds_exist

IPython/testing/decorators.py:363–371  ·  view source on GitHub ↗

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

(*commands)

Source from the content-addressed store, hash-verified

361
362
363def onlyif_cmds_exist(*commands):
364 """
365 Decorator to skip test when at least one of `commands` is not found.
366 """
367 for cmd in commands:
368 if not shutil.which(cmd):
369 return skip("This test runs only if command '{0}' "
370 "is installed".format(cmd))
371 return null_deco
372
373def onlyif_any_cmd_exists(*commands):
374 """

Callers

nothing calls this directly

Calls 2

skipFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected