def runtest(hier, code):
    root = tempfile.mkdtemp()
    mkhier(root, hier)
    savepath = sys.path[:]
    fd, fname = tempfile.mkstemp(text=True)
    os.write(fd, code)
    os.close(fd)
    try:
        sys.path.insert(0, root)
        if verbose: print "sys.path =", sys.path
        try:
            execfile(fname, globals(), {})
        except:
            traceback.print_exc(file=sys.stdout)
    finally:
        sys.path[:] = savepath
        os.unlink(fname)
        try:
            cleanout(root)
        except (os.error, __HOLE__):
            pass

# Test descriptions
dataset/ETHPy150Open babble/babble/include/jython/Lib/test/test_pkg.py/runtest