[Bug 2084715] Re: recent date test causes new builds to fail
Rodrigo Figueiredo Zaiden
2084715 at bugs.launchpad.net
Wed Oct 16 19:03:10 UTC 2024
** Also affects: python-urllib3 (Ubuntu Noble)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to python-urllib3 in Ubuntu.
https://bugs.launchpad.net/bugs/2084715
Title:
recent date test causes new builds to fail
Status in python-urllib3 package in Ubuntu:
In Progress
Bug description:
When attempting to build python-urllib3 for Ubuntu LTS 24.04, the test
called "test_recent_date" fails, causing the build to fail.
AssertionError: assert datetime.date(2022, 1, 1) >
datetime.date(2022, 10, 17)
The test involves getting today's date minus a delta of 2 years and
checking against "RECENT_DATE" variable, which is set to 1st of
January 2022. As of the 1st of January 2024 all new builds fail on
Ubuntu LTS 24.04.
Full Trace:
_______________________ TestConnection.test_recent_date
________________________
self = <test.test_connection.TestConnection object at 0x7cf9c3ed4320>
def test_recent_date(self) -> None:
# This test is to make sure that the RECENT_DATE value
# doesn't get too far behind what the current date is.
# When this test fails update urllib3.connection.RECENT_DATE
# according to the rules defined in that file.
two_years = datetime.timedelta(days=365 * 2)
> assert RECENT_DATE > (datetime.datetime.today() - two_years).date()
E AssertionError: assert datetime.date(2022, 1, 1) > datetime.date(2022, 10, 17)
E + where datetime.date(2022, 10, 17) = <built-in method date of datetime.datetime object at 0x7cf9c32c0c60>()
E + where <built-in method date of datetime.datetime object at 0x7cf9c32c0c60> = (datetime.datetime(2024, 10, 16, 15, 31, 59, 740879) - datetime.timedelta(days=730)).date
E + where datetime.datetime(2024, 10, 16, 15, 31, 59, 740879) = <built-in method today of type object at 0xa4fd20>()
E + where <built-in method today of type object at 0xa4fd20> = <class 'datetime.datetime'>.today
E + where <class 'datetime.datetime'> = datetime.datetime
test/test_connection.py:206: AssertionError
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-urllib3/+bug/2084715/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list