def test_build_event(self):
        evt = event.build_event("evt_name", arg1="val1", arg2=None)
        assert evt.name == "evt_name"
        assert evt.args == {'arg1': "val1", 'arg2': None}
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", [])