diff options
| author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-02-15 15:51:17 (GMT) |
|---|---|---|
| committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-02-15 15:51:17 (GMT) |
| commit | 6233b36d142572ca35b3563657c539210c554dd6 (patch) | |
| tree | d78e59e8b8b726e33c1fe4487a95528ef8b4dd55 /Lib/test | |
| parent | 42bb7ca9e4559222e22aa44f30f8854e2110b9b8 (diff) | |
| download | cpython-6233b36d142572ca35b3563657c539210c554dd6.zip cpython-6233b36d142572ca35b3563657c539210c554dd6.tar.gz cpython-6233b36d142572ca35b3563657c539210c554dd6.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/test')
| -rw-r--r-- | Lib/test/test_time.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 0cec3e4..d70b59f 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) |
