When we write tests for complex applications, the application will often rely on some files that ned to be read. For example configuration files.

In addition the application might create files while the test is running or change some of the existing files.

We would like to be sure these changes don't interfer with the regular work of the rest of the computer and even if we run several tets in parallel that might all want to change the same file, these tests won't interfer with each other.

The best course of action for us is to use a unique temporary directory for each test function.