def with_requires(*requirements):
    ws = pkg_resources.WorkingSet()
    try:
        ws.require(*requirements)
        skip = False
    except pkg_resources.VersionConflict:
        skip = True

    msg = 'requires: {}'.format(','.join(requirements))
    return unittest.skipIf(skip, msg)
Run a test case only when given requirements are satisfied.
dataset/ETHPy150Open pfnet/chainer/cupy/testing/helper.py/with_requires