class_docstr: Object returned by the ``monkeypatch`` fixture keeping a record of setattr/item/env/syspath changes.
      
class_docstr_tok: ["Object","returned","by","the","``","monkeypatch","``","fixture","keeping","a","record","of","setattr\/item\/env\/syspath","changes","."]
docstr: Prepend ``path`` to ``sys.path`` list of import locations. 
docstr_tok: ["Prepend","``","path","``","to","``","sys.path","``","list","of","import","locations","."]
code: def syspath_prepend(self, path):
      """Prepend ``path`` to ``sys.path`` list of import locations."""
      from pkg_resources import fixup_namespace_packages
  
      if self._savesyspath is None:
          self._savesyspath = sys.path[:]
      sys.path.insert(0, str(path))
  
      # https://github.com/pypa/setuptools/blob/d8b901bc/docs/pkg_resources.txt#L162-L171
      fixup_namespace_packages(str(path))
  
      # A call to syspathinsert() usually means that the caller wants to
      # import some dynamically created files, thus with python3 we
      # invalidate its import caches.
      # This is especially important when any namespace package is in used,
      # since then the mtime based FileFinder cache (that gets created in
      # this case already) gets not invalidated when writing the new files
      # quickly afterwards.
      if sys.version_info >= (3, 3):
          from importlib import invalidate_caches
  
          invalidate_caches()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import re
  import sys
  import warnings
  from contextlib import contextmanager
  import six
  import pytest
  from _pytest.fixtures import fixture
  from _pytest.pathlib import Path
label_desc: Use image node_id 10 for calling the MonkeyPatch obj's underlying member method code with example usage: obj.syspath_prepend(path) without return types