Vehicle-Anti-Theft-Face-Rec.../venv/Lib/site-packages/nbconvert/tests/utils.py

13 lines
366 B
Python
Raw Normal View History

2020-11-12 16:05:57 +00:00
import pytest
from shutil import which
def onlyif_cmds_exist(*commands):
"""
Decorator to skip test when at least one of `commands` is not found.
"""
for cmd in commands:
if not which(cmd):
return pytest.mark.skip("This test runs only if command '{0}' "
"is installed".format(cmd))
return lambda f: f