churchyard / rpms / python38

Forked from rpms/python38 5 years ago
Clone
4f22584
From 0165caf04ef9c615c8b86dd16f7c201ca7a0befa Mon Sep 17 00:00:00 2001
4f22584
From: Victor Stinner <vstinner@redhat.com>
4f22584
Date: Tue, 27 Nov 2018 12:40:50 +0100
4f22584
Subject: [PATCH] bpo-35317: Fix mktime() error in test_email (GH-10721)
4f22584
4f22584
Fix mktime() overflow error in test_email: run
4f22584
test_localtime_daylight_true_dst_true() and
4f22584
test_localtime_daylight_false_dst_true() with a specific timezone.
4f22584
(cherry picked from commit cfaafda8e3e19764682abb4bd4c574accb784c42)
4f22584
4f22584
Co-authored-by: Victor Stinner <vstinner@redhat.com>
4f22584
---
4f22584
 Lib/test/test_email/test_utils.py                              | 2 ++
4f22584
 .../NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst | 3 +++
4f22584
 2 files changed, 5 insertions(+)
4f22584
 create mode 100644 Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst
4f22584
4f22584
diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py
4f22584
index 6dcb3bbe7aab..4e3c3f3a195f 100644
4f22584
--- a/Lib/test/test_email/test_utils.py
4f22584
+++ b/Lib/test/test_email/test_utils.py
4f22584
@@ -75,6 +75,7 @@ def test_localtime_daylight_false_dst_false(self):
4f22584
         t2 = utils.localtime(t1)
4f22584
         self.assertEqual(t1, t2)
4f22584
 
4f22584
+    @test.support.run_with_tz('Europe/Minsk')
4f22584
     def test_localtime_daylight_true_dst_true(self):
4f22584
         test.support.patch(self, time, 'daylight', True)
4f22584
         t0 = datetime.datetime(2012, 3, 12, 1, 1)
4f22584
@@ -82,6 +83,7 @@ def test_localtime_daylight_true_dst_true(self):
4f22584
         t2 = utils.localtime(t1)
4f22584
         self.assertEqual(t1, t2)
4f22584
 
4f22584
+    @test.support.run_with_tz('Europe/Minsk')
4f22584
     def test_localtime_daylight_false_dst_true(self):
4f22584
         test.support.patch(self, time, 'daylight', False)
4f22584
         t0 = datetime.datetime(2012, 3, 12, 1, 1)
4f22584
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
4f22584
new file mode 100644
4f22584
index 000000000000..73a30f71927f
4f22584
--- /dev/null
4f22584
+++ b/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst
4f22584
@@ -0,0 +1,3 @@
4f22584
+Fix ``mktime()`` overflow error in ``test_email``: run
4f22584
+``test_localtime_daylight_true_dst_true()`` and
4f22584
+``test_localtime_daylight_false_dst_true()`` with a specific timezone.