diff options
Diffstat (limited to 'Lib/test/test_time.py')
-rw-r--r-- | Lib/test/test_time.py | 9 |
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) |