summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-06-08 16:58:31 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-06-08 16:58:31 (GMT)
commit0c687e5e88f044f5f65d4476970d7ec12dc67dbb (patch)
treeb904448cf5c6389aaa17563f506a9eda1c3ad346
parent0bf506cca56f5f7ab994ed67b3a8cb7ac897b5ec (diff)
downloadcpython-0c687e5e88f044f5f65d4476970d7ec12dc67dbb.zip
cpython-0c687e5e88f044f5f65d4476970d7ec12dc67dbb.tar.gz
cpython-0c687e5e88f044f5f65d4476970d7ec12dc67dbb.tar.bz2
Relax datetime.timestamp() test around DST change
-rw-r--r--Lib/test/datetimetester.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 9d84b9d..266ef69 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)