Pytest has a tutorial How to use temporary directories and files in tests. The explicit creation of temporary dirs and files via package tempfile is not preferred. Nor is the previous Pytest system of tmpdir and tmpdir_factory. Instead, we should use
tmp_path and
tmp_path_factory
While we're modernizing our code, why not do that update, too?
Pytest has a tutorial How to use temporary directories and files in tests. The explicit creation of temporary dirs and files via package
tempfile
is not preferred. Nor is the previous Pytest system oftmpdir
andtmpdir_factory
. Instead, we should usetmp_path
andtmp_path_factory
While we're modernizing our code, why not do that update, too?