def setenv(self, name, value, prepend=None):
if not isinstance(value, str):<EOL><INDENT>warnings.warn(<EOL>pytest.PytestWarning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>name=name, value=value, type=type(value).__name__<EOL>)<EOL>),<EOL>stacklevel=<NUM_LIT:2>,<EOL>)<EOL>value = str(value)<EOL><DEDENT>if prepend and name in os.environ:<EOL><INDENT>value = value + prepend + os.environ[name]<EOL><DEDENT>self._warn_if_env_name_is_not_str(name)<EOL>self.setitem(os.environ, name, value)<EOL>
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.