Use datetime.utcfromtimestamp() in tests.
authorDave Borowitz <dborowitz@google.com>
Fri, 9 Apr 2010 22:39:12 +0000 (00:39 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 9 Apr 2010 22:39:12 +0000 (00:39 +0200)
commitc7c54e8b4386c016e09d186006a40c9cc9c6335a
treea031ab667a1b64ae9b5d3284aeac72dd126a90bd
parent90b4bc0222c5d069ceed40f3c7cffc5769a319b9
Use datetime.utcfromtimestamp() in tests.

datetime.fromtimestamp() has the confusing behavior of treating the
timestamp as a UTC time and then converting to local time, but not
setting the tzinfo member. As a result, the function returns different
values depending on the local timezone, which makes it hard to write a
test that passes everywhere.

The output of datetime.utcfromtimestamp() is stable across all
timezones, which is all we really need for tests. (Returning sensible
datetime objects from the Commit/Tag API would require substantially
more work, but that is not fixed in this change.)

Tested in both US-Pacific and US-Eastern.
dulwich/tests/test_objects.py