test: Ensure tests use tmp_path fixture so it's cleaned up properly
Without this, tests are leaving leftovers in /tmp after running tests. This commit fixes
that by using tmp_path as root directory which is properly cleaned up when tests are
done.
Related to T3719