guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help fixing testcases with time-difference


From: Vincent Legoll
Subject: Re: Need help fixing testcases with time-difference
Date: Thu, 18 Aug 2016 10:59:20 +0200

Hello,

On Thu, Aug 18, 2016 at 10:05 AM, Hartmut Goebel
<address@hidden> wrote:
> Hi,
>
> I'm currently working on django, the web application framework.
> Unfortunalty some tests fail. These are all testing time- and timezone
> calculations.
>
> Failures are like this:
>
> AssertionError: datetime.timedelta(0, 3600, 16) not less than
> datetime.timedelta(0, 2)
>
> which means the returned time difference is ca. 1 hour, but allowed are
> only 2 minutes. The testcase os this one
> https://github.com/django/django/blob/master/tests/file_storage/tests.py#L239>
>
> I already added tzdata to native-inputs, but this does not solve the issue.
>
> Any hints?

That looks like a Daylight Saving Time mismatch, could that be possible ?

DST is 1h delta, which would be datetime.timedelta(0, 3600), thus if we remove
that, the test assertion becomes true...

>>> assert datetime.timedelta(0, 3600, 16) < datetime.timedelta(0, 2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AssertionError
>>> assert (datetime.timedelta(0, 3600, 16) - datetime.timedelta(0, 3600)) < 
>>> datetime.timedelta(0, 2)

WDYT?

-- 
Vincent Legoll



reply via email to

[Prev in Thread] Current Thread [Next in Thread]