def importorskip(modname, minversion=None):
    __tracebackhide__ = True
    compile(modname, '', 'eval') # to catch syntaxerrors
    try:
        __import__(modname)
    except ImportError:
        skip("could not import %r" %(modname,))
    mod = sys.modules[modname]
    if minversion is None:
        return mod
    verattr = getattr(mod, '__version__', None)
    if minversion is not None:
        try:
            from pkg_resources import parse_version as pv
        except ImportError:
            skip("we have a required version for %r but can not import "
                 "no pkg_resources to parse version strings." %(modname,))
        if verattr is None or pv(verattr) < pv(minversion):
            skip("module %r has __version__ %r, required is: %r" %(
                 modname, verattr, minversion))
    return mod
return imported module if it has at least "minversion" as its
dataset/ETHPy150Open pytest-dev/pytest/_pytest/runner.py/importorskip