def METHOD_NAME(cls):
    # make sure we have a window to work with
    original_window_id = sublime.active_window().id()
    sublime.run_command("new_window")
    yield lambda: sublime.active_window().id() != original_window_id
    cls.window = sublime.active_window()
    s = sublime.load_settings("Preferences.sublime-settings")
    s.set("close_windows_when_empty", False)