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 test_telemetry_imports_hf(runner, live_mock_server, parse_ctx):
    with runner.isolated_filesystem():
        run = wandb.init()

        with mock.patch.dict("sys.modules", {"transformers": mock.Mock()}):
            import transformers

            run.finish()

            ctx_util = parse_ctx(live_mock_server.get_ctx())
            telemetry = ctx_util.telemetry

            # hf in finish modules but not in init modules
            assert telemetry and 11 not in telemetry.get("1", [])
            assert telemetry and 11 in telemetry.get("2", [])