def test_iadd(self, evt):
        rval = event.ReturnValue(append_events=[evt])
        rval2 = event.ReturnValue(eat=True, append_events=[evt])
        rset = event.ResultSet()

        rset += rval
        rset += rval2
        rset += None
        assert rset.eat
        assert rset.append_events == [evt, evt]
def exiter_as_until_exception(
        cls, new_exiter_fun: Callable[[Optional[Exiter]], Exiter]
    ) -> Iterator[None]:
        """Temporarily override the global exiter, except this will unset it when an exception
        happens."""
        previous_exiter = cls._exiter
        new_exiter = new_exiter_fun(previous_exiter)
        try:
            cls._reset_exiter(new_exiter)
            yield
        finally:
            cls._reset_exiter(previous_exiter)