Wraps the stable or the beta `accumulate_event`, which the stream helpers and the spans share, so that the type of each event it takes is added to the list returned.
(monkeypatch: pytest.MonkeyPatch, *, beta: bool)
| 818 | |
| 819 | |
| 820 | def count_accumulated_events(monkeypatch: pytest.MonkeyPatch, *, beta: bool) -> list[str]: |
| 821 | """Wraps the stable or the beta `accumulate_event`, which the stream helpers and the spans share, so that |
| 822 | the type of each event it takes is added to the list returned. |
| 823 | """ |
| 824 | module = _beta_messages if beta else _messages |
| 825 | accumulate_event = module.accumulate_event |
| 826 | accumulated: list[str] = [] |
| 827 | |
| 828 | def counting(**kwargs: Any) -> Any: |
| 829 | accumulated.append(kwargs["event"].type) |
| 830 | return accumulate_event(**kwargs) |
| 831 | |
| 832 | monkeypatch.setattr(module, "accumulate_event", counting) |
| 833 | return accumulated |
| 834 | |
| 835 | |
| 836 | def events_up_to_message_delta() -> list[dict[str, Any]]: |
no outgoing calls
no test coverage detected