def test_iter(self):
        prio_set_list = event._PrioritizedSetList()
        objs = [(i,) for i in range(5)]
        for i, obj in enumerate(objs):
            prio_set_list.add(-i, obj)

        for i, set_ in enumerate(prio_set_list):
            assert set_ == (-i, {objs[i]})
def test_telemetry_imports_catboost(runner, live_mock_server, parse_ctx):
    with runner.isolated_filesystem():
        with mock.patch.dict("sys.modules", {"catboost": mock.Mock()}):
            import catboost

            run = wandb.init()
            run.finish()

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

            # catboost in both init and finish modules
            assert telemetry and 7 in telemetry.get("1", [])
            assert telemetry and 7 in telemetry.get("2", [])