class_docstr: backward comptibility wrapper that implements
  :class:``py.path.local`` for :class:``TempPathFactory``
class_docstr_tok: ["backward","comptibility","wrapper","that","implements",":","class",":","``","py.path.local","``","for",":","class",":","``","TempPathFactory","``"]
docstr: (deprecated) return temporary directory path with
  the given string as the trailing part.  It is usually
  better to use the 'tmpdir' function argument which
  provides an empty unique-per-test-invocation directory
  and is guaranteed to be empty.
docstr_tok: ["(","deprecated",")","return","temporary","directory","path","with","the","given","string","as","the","trailing","part",".","It","is","usually","better","to","use","the","'tmpdir","'","function","argument","which","provides","an","empty","unique-per-test-invocation","directory","and","is","guaranteed","to","be","empty","."]
code: def ensuretemp(self, string, dir=1):
      """(deprecated) return temporary directory path with
      the given string as the trailing part.  It is usually
      better to use the 'tmpdir' function argument which
      provides an empty unique-per-test-invocation directory
      and is guaranteed to be empty.
      """
      # py.log._apiwarn(">1.1", "use tmpdir function argument")
      from .deprecated import PYTEST_ENSURETEMP
  
      warnings.warn(PYTEST_ENSURETEMP, stacklevel=2)
      return self.getbasetemp().ensure(string, dir=dir)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import re
  import tempfile
  import warnings
  import attr
  import py
  import six
  import pytest
  from .pathlib import ensure_reset_dir
  from .pathlib import LOCK_TIMEOUT
  from .pathlib import make_numbered_dir
  from .pathlib import make_numbered_dir_with_cleanup
  from .pathlib import Path
  from _pytest.monkeypatch import MonkeyPatch
label_desc: Use image node_id 1 for calling the TempdirFactory obj's underlying member method code with example usage: obj.ensuretemp(string, dir) and returns: self