Public bug reported:

When attempting to build python-urllib3, 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

** Affects: python-urllib3 (Ubuntu)
     Importance: Undecided
     Assignee: Hlib Korzhynskyy (hlibk)
         Status: In Progress

** Changed in: python-urllib3 (Ubuntu)
     Assignee: (unassigned) => Hlib Korzhynskyy (hlibk)

** Changed in: python-urllib3 (Ubuntu)
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2084715

Title:
  recent date test causes new builds to fail

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-urllib3/+bug/2084715/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to