Is there an advantage to pickling through a physical file instead of just using `dumps` and `loads`?  At the least you could use a `StringIO` object to avoid the caller being required to give a file name `testfile`.