MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / usage

Function usage

lib/cli/tests/test_run_usage.py:133–150  ·  view source on GitHub ↗
(monkeypatch: pytest.MonkeyPatch, error_classes: list[str | None])

Source from the content-addressed store, hash-verified

131
132@pytest.fixture
133def usage(monkeypatch: pytest.MonkeyPatch, error_classes: list[str | None]) -> list[str]:
134 sent: list[str] = []
135
136 class FakeTelemetry:
137 def set_tracer(self) -> None:
138 pass
139
140 def feature_usage_span(self, feature: str, attributes: Any = None) -> None:
141 assert feature in ALLOWED_EVENTS, feature
142 if feature == stopped("load_failed"):
143 assert attributes is None or set(attributes) == {"error_class"}
144 error_classes.append(None if attributes is None else attributes["error_class"])
145 else:
146 assert attributes is None, feature
147 sent.append(feature)
148
149 monkeypatch.setattr("crewai_core.telemetry.Telemetry", FakeTelemetry)
150 return sent
151
152
153@pytest.fixture

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected