I think this only makes sense if we are running the scripts from the local directory.  In general, if we're testing an installed nibabel, we can't know the relationship of the library directory to the script directory, and we might be putting some random directory on the PYTHONPATH instead.  So maybe something like:

    if not LOCAL_SCRIPT_DIR is None:
        env = {'PYTHONPATH': '%s:%s' % (IMPORT_PATH, os.environ.get('PYTHONPATH', ''))}
    else:
        env = None

sort of thing.