Replace usage of pytz
The current usage can be replaced by built-in datatime module. pytz is not currently in test requirements and it is no longer required by oslo.utils in Python 3.11. Change-Id: Ib490f5aebc5c84daf28edc3698694d70a74a4715 (cherry picked from commit84dacbe8df
) (cherry picked from commit181d2250ea
) (cherry picked from commit51e639fd78
)
This commit is contained in:
parent
bdd1d27dd3
commit
d526c793a8
|
@ -16,7 +16,6 @@ import copy
|
|||
import datetime
|
||||
import jsonschema
|
||||
import logging
|
||||
import pytz
|
||||
from unittest import mock
|
||||
|
||||
from oslo_context import context
|
||||
|
@ -1097,7 +1096,7 @@ class _TestObject(object):
|
|||
obj.obj_reset_changes()
|
||||
self.assertEqual({}, obj.obj_get_changes())
|
||||
|
||||
timestamp = datetime.datetime(2001, 1, 1, tzinfo=pytz.utc)
|
||||
timestamp = datetime.datetime(2001, 1, 1, tzinfo=datetime.timezone.utc)
|
||||
with mock.patch.object(timeutils, 'utcnow') as mock_utcnow:
|
||||
mock_utcnow.return_value = timestamp
|
||||
obj.timestamp = timeutils.utcnow()
|
||||
|
|
Loading…
Reference in New Issue