##// END OF EJS Templates
make skip also skip with pytest
Matthias Bussonnier -
Show More
@@ -376,9 +376,14 b' def onlyif_cmds_exist(*commands):'
376 Decorator to skip test when at least one of `commands` is not found.
376 Decorator to skip test when at least one of `commands` is not found.
377 """
377 """
378 for cmd in commands:
378 for cmd in commands:
379 reason = "This test runs only if command '{cmd}' is installed"
379 if not shutil.which(cmd):
380 if not shutil.which(cmd):
380 return skip("This test runs only if command '{0}' "
381 if os.environ.get("IPTEST_WORKING_DIR", None) is not None:
381 "is installed".format(cmd))
382 return skip(reason)
383 else:
384 import pytest
385
386 return pytest.mark.skip(reason=reason)
382 return null_deco
387 return null_deco
383
388
384 def onlyif_any_cmd_exists(*commands):
389 def onlyif_any_cmd_exists(*commands):
General Comments 0
You need to be logged in to leave comments. Login now