Fix tests to pass on Windows
Hello, I've tried resolving #21 by implementing the fix mentioned in the linked StackOverflow answer.
With these changes, all tests pass when run on my Windows machine.
I'm a noob when it comes to different OS behaviours so I'm very much just blindly hoping this doesn't break it on Unix!
I'll definitely flag this solution doesn't fully sit right with me. It kind of defeats the point of using a temporary file when it has to be manually deleted...
I'd be equally happy with some flag in the documentation that the tests should be run on a particular OS.
Dear @hollowscene,
thank you for bringing this up! Your PR works perfectly and was (with minor modifications) merged into the main branch. This seems to be the proper way to deal with it on Windows. tempfile.NamedTemporaryFile(delete = True) keeps the file connection open, preventing Windows accessing that very same file for reading, resulting in the 'permission error'. Thus, there seems to be no way around manually deleting the files.
Tested on Windows 10 and Linux (Debian, Ubuntu).