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: Set environment variable ``name`` to ``value``.  If ``prepend``
  is a character, read the current environment variable value
  and prepend the ``value`` adjoined with the ``prepend`` character.
docstr_tok: ["Set","environment","variable","``","name","``","to","``","value","``",".","If","``","prepend","``","is","a","character",",","read","the","current","environment","variable","value","and","prepend","the","``","value","``","adjoined","with","the","``","prepend","``","character","."]
code: def setenv(self, name, value, prepend=None):
      """Set environment variable ``name`` to ``value``.  If ``prepend``
      is a character, read the current environment variable value
      and prepend the ``value`` adjoined with the ``prepend`` character.
      """
      if not isinstance(value, str):
          warnings.warn(
              pytest.PytestWarning(
                  "Value of environment variable {name} type should be str, but got "
                  "{value!r} (type: {type}); converted to str implicitly".format(
                      name=name, value=value, type=type(value).__name__
                  )
              ),
              stacklevel=2,
          )
          value = str(value)
      if prepend and name in os.environ:
          value = value + prepend + os.environ[name]
      self._warn_if_env_name_is_not_str(name)
      self.setitem(os.environ, name, value)
  
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 8 for calling the MonkeyPatch obj's underlying member method code with example usage: obj.setenv(name, value, prepend) without return types