def tmpfilepath(): fd, fname = tempfile.mkstemp(prefix='djpt-test-') os.close(fd) yield fname os.remove(fname)