So the move from iso8601===0.1.11 to iso8601===0.1.12 broke the unit tests in oslo.utils
iso8601 used to do: from datetime import datetime ...
But now they do: import iso8601. And then use datetime.datetime()
Unfortunately the unit tests mock datetime.datetime() and now are mocking the one in iso8601. This causes a failure in the unit tests.
So the move from iso8601===0.1.11 to iso8601===0.1.12 broke the unit tests in oslo.utils
iso8601 used to do: from datetime import datetime ...
But now they do: import iso8601. And then use datetime.datetime()
Unfortunately the unit tests mock datetime.datetime() and now are mocking the one in iso8601. This causes a failure in the unit tests.
The issue is in these two locations: /github. com/openstack/ oslo.utils/ blob/master/ oslo_utils/ tests/test_ timeutils. py#L92 /github. com/openstack/ oslo.utils/ blob/master/ oslo_utils/ tests/test_ timeutils. py#L123
https:/
https:/
The error looks like this:
FAIL: oslo_utils. tests.test_ timeutils. TimeUtilsTest. test_is_ newer_than_ str ------- ------- ------- ------- ------- ------- ------- ------- ------- tests/test_ timeutils. py", line 140, in test_is_ newer_than_ str _test_is_ newer_than( timeutils. strtime) tests/test_ timeutils. py", line 127, in _test_is_newer_than timeutils. py", line 135, in is_newer_than timedelta( seconds= seconds) ======= ======= ======= ======= ======= ======= ======= ======= ======= tests.test_ timeutils. TimeUtilsTest. test_is_ older_than_ str ------- ------- ------- ------- ------- ------- ------- ------- ------- tests/test_ timeutils. py", line 109, in test_is_ older_than_ str _test_is_ older_than( timeutils. strtime) tests/test_ timeutils. py", line 96, in _test_is_older_than timeutils. py", line 120, in is_older_than timedelta( seconds= seconds)
-------
Traceback (most recent call last):
File "oslo_utils/
self.
File "oslo_utils/
59)
File "oslo_utils/
return after - utcnow() > datetime.
TypeError: can't compare datetime.timedelta to MagicMock
=======
FAIL: oslo_utils.
-------
Traceback (most recent call last):
File "oslo_utils/
self.
File "oslo_utils/
59)
File "oslo_utils/
return utcnow() - before > datetime.
TypeError: can't compare datetime.timedelta to MagicMock