(I’m using Python 2.6 and nose.)
I’m writing tests for my Python app. I want one test to open a new file, close it, and then delete it. Naturally, I prefer that this will happen inside a temporary directory, because I don’t want to trash the user’s filesystem. And, it needs to be cross-OS.
How do I do it?
See the tempfile module in the standard library — should be all you need.