Python: How do I make temporary files in my test suite?
FWIW using py.test you can write: def test_function(tmpdir): # tmpdir is a unique-per-test-function invocation temporary directory Each test function using the “tmpdir” function argument will get a clean empty directory, created as a sub directory of “/tmp/pytest-NUM” (linux, win32 has different path) where NUM is increased for each test run. The last three directories are … Read more