summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-02-15 15:40:59 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-02-15 15:40:59 (GMT)
commit4fb96f41f4525c25dcba386db96e5298e563cf65 (patch)
treed22aea3af41a09a568d84436d2d0255dfc0583ae /Lib
parent725cb96d8a37baefc6a5336c4c49d093549b4217 (diff)
downloadcpython-4fb96f41f4525c25dcba386db96e5298e563cf65.zip
cpython-4fb96f41f4525c25dcba386db96e5298e563cf65.tar.gz
cpython-4fb96f41f4525c25dcba386db96e5298e563cf65.tar.bz2
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')
-rw-r--r--Lib/test/test_time.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 8c1d8f8..d4f7d80 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -233,6 +233,15 @@ 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)
+
class TestLocale(unittest.TestCase):
def setUp(self):
self.oldloc = locale.setlocale(locale.LC_ALL)