mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-21 05:48:14 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user