]> granicus.if.org Git - python/commitdiff
Relax datetime.timestamp() test around DST change
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>
Fri, 8 Jun 2012 17:00:27 +0000 (13:00 -0400)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>
Fri, 8 Jun 2012 17:00:27 +0000 (13:00 -0400)
Lib/test/datetimetester.py

index 266ef696759133167ecf0f399be4318b1dec580c..a4180ae69c8a8fd5544e9a4db88b0ebd04dc67a8 100644 (file)
@@ -1747,7 +1747,7 @@ class TestDateTime(TestDate):
         # Missing hour may produce platform-dependent result
         t = self.theclass(2012, 3, 11, 2, 30)
         self.assertIn(self.theclass.fromtimestamp(t.timestamp()),
-                      [t, t + timedelta(hours=1)])
+                      [t - timedelta(hours=1), 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)