I am writing some unit tests for a piece of code that takes a path and attempts to load the file if it has a known extension, then does more careful checking.
In the
did you try?
fd, path =tempfile.mkstemp(suffix = '.tif') print(path)