all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vincent Legoll <vincent.legoll@gmail.com>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Need help fixing testcases with time-difference
Date: Thu, 18 Aug 2016 10:59:20 +0200	[thread overview]
Message-ID: <CAEwRq=pO1PbxS_w4_yj2AjTS78b09B2BroMce-VR28Z6xJYHSw@mail.gmail.com> (raw)
In-Reply-To: <57B56C3D.4050705@crazy-compilers.com>

Hello,

On Thu, Aug 18, 2016 at 10:05 AM, Hartmut Goebel
<h.goebel@crazy-compilers.com> 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	other threads:[~2016-08-18  8:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18  8:05 Need help fixing testcases with time-difference Hartmut Goebel
2016-08-18  8:59 ` Vincent Legoll [this message]
2016-08-18  9:50   ` Hartmut Goebel
2016-08-18 11:10     ` Vincent Legoll
2016-08-18 12:14       ` Hartmut Goebel
2016-08-18 13:04         ` Vincent Legoll
2016-08-18 13:27           ` Vincent Legoll
2016-08-18 13:47 ` Marius Bakke
2016-08-18 15:17   ` Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEwRq=pO1PbxS_w4_yj2AjTS78b09B2BroMce-VR28Z6xJYHSw@mail.gmail.com' \
    --to=vincent.legoll@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.