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

Function reset_event_state

conftest.py:238–249  ·  view source on GitHub ↗

Reset event system state before each test for isolation.

()

Source from the content-addressed store, hash-verified

236
237@pytest.fixture(autouse=True, scope="function")
238def reset_event_state() -> None:
239 """Reset event system state before each test for isolation."""
240 from crewai.events.base_events import reset_emission_counter
241 from crewai.events.event_context import (
242 EventContextConfig,
243 _event_context_config,
244 _event_id_stack,
245 )
246
247 reset_emission_counter()
248 _event_id_stack.set(())
249 _event_context_config.set(EventContextConfig())
250
251
252_ENV_RESTORED_AFTER_EACH_TEST = ("CREWAI_DISABLE_TELEMETRY", "OTEL_SDK_DISABLED")

Callers

nothing calls this directly

Calls 3

reset_emission_counterFunction · 0.90
EventContextConfigClass · 0.90
setMethod · 0.45

Tested by

no test coverage detected