fix: reset telemetry singleton in tests to prevent state persistence on Python 3.10

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-18 10:48:17 +00:00
parent c1984e4406
commit 9d09e01800
2 changed files with 9 additions and 0 deletions

View File

@@ -107,6 +107,12 @@ class Telemetry:
cls._instance._initialized = False
return cls._instance
@classmethod
def _reset_instance(cls):
"""Reset the singleton instance for testing purposes."""
with cls._lock:
cls._instance = None
def __init__(self) -> None:
if hasattr(self, '_initialized') and self._initialized:
return