This will crash if the user runs nosetests from a directory where they don't have write permissions. There are two ways around this.

The easier one is to just write a function that generates the data and call it with an !obj tag instead of loading the dataset from a !pkl tag.

The slightly more involved way is to put your .pkl files in the same directory as the test:

    directory = os.path.split(os.path.realpath(__file__))[0]
    path = os.path.join(directory, "{}_dataset.pkl".format(name))

and then dump to `path`.