From de7d3363069f6694ce15e38c29c7efa0619ccc40 Mon Sep 17 00:00:00 2001 From: Maira Usman Date: Mon, 18 Mar 2024 20:48:00 +0500 Subject: [PATCH] refactor: Replace pytz usage with zoneinfo module (#2280) --- localbuild/meta.yaml | 1 - tests/_test_mscolab/test_models.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/localbuild/meta.yaml b/localbuild/meta.yaml index 1c146bff0..a5fa39de7 100644 --- a/localbuild/meta.yaml +++ b/localbuild/meta.yaml @@ -47,7 +47,6 @@ requirements: - netcdf4 - hdf4 - pillow - - pytz - pyqt >=5.15.0 - qt >=5.15.0 - requests >=2.31.0 diff --git a/tests/_test_mscolab/test_models.py b/tests/_test_mscolab/test_models.py index 3ec9e9dd1..f7f34faa0 100644 --- a/tests/_test_mscolab/test_models.py +++ b/tests/_test_mscolab/test_models.py @@ -27,7 +27,7 @@ import pytest import datetime import textwrap -import pytz +from zoneinfo import ZoneInfo from mslib.mscolab.server import register_user from mslib.mscolab.models import AwareDateTime, User, Permission, Operation, Message, Change @@ -48,7 +48,7 @@ def test_aware_datetime_conversion(): result_none = aware_datetime_type.process_bind_param(None, None) assert result_none is None - cet_time = datetime.datetime.now(tz=pytz.timezone("CET")) + cet_time = datetime.datetime.now(tz=ZoneInfo("CET")) result_cet = aware_datetime_type.process_bind_param(cet_time, None) assert result_cet == cet_time assert result_cet is not None