From: Alexander Belopolsky Date: Fri, 8 Jun 2012 16:58:31 +0000 (-0400) Subject: Relax datetime.timestamp() test around DST change X-Git-Tag: v3.3.0b1~254 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c687e5e88f044f5f65d4476970d7ec12dc67dbb;p=thirdparty%2FPython%2Fcpython.git Relax datetime.timestamp() test around DST change --- diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 9d84b9dea0dd..266ef6967591 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1744,10 +1744,10 @@ class TestDateTime(TestDate): t = self.theclass(1970, 1, 1, 1, 2, 3, 4) self.assertEqual(t.timestamp(), 18000.0 + 3600 + 2*60 + 3 + 4*1e-6) - # Missing hour defaults to standard time + # Missing hour may produce platform-dependent result t = self.theclass(2012, 3, 11, 2, 30) - self.assertEqual(self.theclass.fromtimestamp(t.timestamp()), - t + timedelta(hours=1)) + self.assertIn(self.theclass.fromtimestamp(t.timestamp()), + [t, t + timedelta(hours=1)]) # Ambiguous hour defaults to DST t = self.theclass(2012, 11, 4, 1, 30) self.assertEqual(self.theclass.fromtimestamp(t.timestamp()), t)