Ejemplo n.º 1
0
def testmod():
    """
    Tests a doctest modules with numba functions. When run in nosetests, only
    populates module.__test__, when run as main, runs the doctests.
    """
    modname = sys._getframe(1).f_globals['__name__']
    mod = __import__(modname)
    doctest_support.testmod(mod, run_doctests=modname == '__main__')
    #if modname == '__main__':
    #    numba.nose_run(mod)
Ejemplo n.º 2
0
def testmod(module=None, runit=False):
    """
    Tests a doctest modules with numba functions. When run in nosetests, only
    populates module.__test__, when run as main, runs the doctests.
    """
    if module is None:
        modname = sys._getframe(1).f_globals['__name__']
        module = __import__(modname)
    else:
        modname = module.__name__

    doctest_support.testmod(module, run_doctests=runit or modname == '__main__')