Improve test coverage
@profile(profiler='hotshot'): don't keep open files unnecessarily

Fixes test failure on Windows, where you can't delete open files.