Avoid writing to the test directory as it may not be writable.