The tmp_path related changes are not necessary to make pytest 7 work, but it feels more complete this way.