summaryrefslogtreecommitdiff
path: root/Lib/test/test_time.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-02-15 15:51:17 +0000
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-02-15 15:51:17 +0000
commit2e766925a20a582cdb997058fd3cb37ca95654fc (patch)
tree4111a48df0707629c6c700a5cca1c7b0480d6f20 /Lib/test/test_time.py
parentc39004d6b0308455beca8abb40f7c1659bc39d7f (diff)
downloadcpython-2e766925a20a582cdb997058fd3cb37ca95654fc.tar.gz
Merged revisions 87919 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87919 | alexander.belopolsky | 2011-01-10 20:21:25 -0500 (Mon, 10 Jan 2011) | 4 lines Issue #1726687: time.mktime() will now correctly compute value one second before epoch. Original patch by Peter Wang, reported by Martin Blais. ........
Diffstat (limited to 'Lib/test/test_time.py')
-rw-r--r--Lib/test/test_time.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 0cec3e4491..d70b59f1d0 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -223,6 +223,16 @@ class TimeTestCase(unittest.TestCase):
t1 = time.mktime(lt1)
self.assertTrue(0 <= (t1-t0) < 0.2)
+ def test_mktime(self):
+ # Issue #1726687
+ for t in (-2, -1, 0, 1):
+ try:
+ tt = time.localtime(t)
+ except (OverflowError, ValueError):
+ pass
+ self.assertEqual(time.mktime(tt), t)
+
+
def test_main():
test_support.run_unittest(TimeTestCase)