mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 17:18:29 +00:00
- Created datetime_compat module to provide UTC constant using timezone.utc - Updated all direct UTC imports to use compatibility module - Added tests to verify UTC timezone compatibility - Fixes #2171 Co-Authored-By: Joe Moura <joao@crewai.com>
15 lines
450 B
Python
15 lines
450 B
Python
"""Test datetime compatibility module."""
|
|
from datetime import timezone
|
|
|
|
from crewai.utilities.datetime_compat import UTC
|
|
|
|
|
|
def test_utc_timezone_compatibility():
|
|
"""Test that UTC timezone is compatible with both Python 3.10 and 3.11+"""
|
|
assert UTC == timezone.utc
|
|
assert UTC.tzname(None) == "UTC"
|
|
# Verify it works with datetime.now()
|
|
from datetime import datetime
|
|
dt = datetime.now(UTC)
|
|
assert dt.tzinfo == timezone.utc
|