mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Relax datetime.timestamp() test around DST change
This commit is contained in:
parent
0bf506cca5
commit
0c687e5e88
1 changed files with 3 additions and 3 deletions
|
@ -1744,10 +1744,10 @@ class TestDateTime(TestDate):
|
||||||
t = self.theclass(1970, 1, 1, 1, 2, 3, 4)
|
t = self.theclass(1970, 1, 1, 1, 2, 3, 4)
|
||||||
self.assertEqual(t.timestamp(),
|
self.assertEqual(t.timestamp(),
|
||||||
18000.0 + 3600 + 2*60 + 3 + 4*1e-6)
|
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)
|
t = self.theclass(2012, 3, 11, 2, 30)
|
||||||
self.assertEqual(self.theclass.fromtimestamp(t.timestamp()),
|
self.assertIn(self.theclass.fromtimestamp(t.timestamp()),
|
||||||
t + timedelta(hours=1))
|
[t, t + timedelta(hours=1)])
|
||||||
# Ambiguous hour defaults to DST
|
# Ambiguous hour defaults to DST
|
||||||
t = self.theclass(2012, 11, 4, 1, 30)
|
t = self.theclass(2012, 11, 4, 1, 30)
|
||||||
self.assertEqual(self.theclass.fromtimestamp(t.timestamp()), t)
|
self.assertEqual(self.theclass.fromtimestamp(t.timestamp()), t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue