'Prepend a directory to sys.path, defaults to :py:attr:`tmpdir`.
This is undone automatically after the test.'

def syspathinsert(self, path=None):

    if (path is None):
        path = self.tmpdir
    sys.path.insert(0, str(path))
    self._possibly_invalidate_import_caches()
