def METHOD_NAME(self):
    """
    This overrides the HOME environment variable, so that paths beginning
    with '~/' expand to the temp directory. In conjunction with
    self.temp(), temporary files are tracked as they are created, so we can
    verify they end up in the temporary directory and not unexpected places
    in the filesystem. Used by the `home_is_temp` fixture.
    """
    self.home_is_temp = True
    # For Unix
    self.monkeypatch.setenv("HOME", self.temp_dir)
    # For Windows
    self.monkeypatch.setenv("USERPROFILE", self.temp_dir)