def ensuretemp(string, dir=1): |
""" return temporary directory path with |
the given string as the trailing part. |
""" |
global basetemp |
if basetemp is None: |
basetemp = py.path.local.make_numbered_dir(prefix='pytest-') |
return basetemp.ensure(string, dir=dir) |