]> granicus.if.org Git - python/commitdiff
bpo-35317: Fix mktime() error in test_email (GH-10721)
authorVictor Stinner <vstinner@redhat.com>
Tue, 27 Nov 2018 11:40:50 +0000 (12:40 +0100)
committerGitHub <noreply@github.com>
Tue, 27 Nov 2018 11:40:50 +0000 (12:40 +0100)
Fix mktime() overflow error in test_email: run
test_localtime_daylight_true_dst_true() and
test_localtime_daylight_false_dst_true() with a specific timezone.

Lib/test/test_email/test_utils.py
Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst [new file with mode: 0644]

index 6dcb3bbe7aab8c07cada9ece94c8ed943d3f5add..4e3c3f3a195fc48124d28e69f56df5ab26048fbc 100644 (file)
@@ -75,6 +75,7 @@ class LocaltimeTests(unittest.TestCase):
         t2 = utils.localtime(t1)
         self.assertEqual(t1, t2)
 
+    @test.support.run_with_tz('Europe/Minsk')
     def test_localtime_daylight_true_dst_true(self):
         test.support.patch(self, time, 'daylight', True)
         t0 = datetime.datetime(2012, 3, 12, 1, 1)
@@ -82,6 +83,7 @@ class LocaltimeTests(unittest.TestCase):
         t2 = utils.localtime(t1)
         self.assertEqual(t1, t2)
 
+    @test.support.run_with_tz('Europe/Minsk')
     def test_localtime_daylight_false_dst_true(self):
         test.support.patch(self, time, 'daylight', False)
         t0 = datetime.datetime(2012, 3, 12, 1, 1)
diff --git a/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst b/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst
new file mode 100644 (file)
index 0000000..73a30f7
--- /dev/null
@@ -0,0 +1,3 @@
+Fix ``mktime()`` overflow error in ``test_email``: run
+``test_localtime_daylight_true_dst_true()`` and
+``test_localtime_daylight_false_dst_true()`` with a specific timezone.