From 9d95cbeaf97887beca3bbee36cb5466268bdf8e1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 5 Nov 2012 02:06:13 +0100 Subject: [PATCH] Close #15165: Fix test_email on Windows 64 bits Use year 1990 instead of year 1970 to avoid issues with negative timestamps. --- Lib/test/test_email/test_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py index 0ade7701127..622ef3a9c90 100644 --- a/Lib/test/test_email/test_utils.py +++ b/Lib/test/test_email/test_utils.py @@ -91,7 +91,7 @@ class LocaltimeTests(unittest.TestCase): @test.support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0') def test_localtime_epoch_utc_daylight_true(self): test.support.patch(self, time, 'daylight', True) - t0 = datetime.datetime(1970, 1, 1, tzinfo = datetime.timezone.utc) + t0 = datetime.datetime(1990, 1, 1, tzinfo = datetime.timezone.utc) t1 = utils.localtime(t0) t2 = t0 - datetime.timedelta(hours=5) t2 = t2.replace(tzinfo = datetime.timezone(datetime.timedelta(hours=-5))) @@ -100,7 +100,7 @@ class LocaltimeTests(unittest.TestCase): @test.support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0') def test_localtime_epoch_utc_daylight_false(self): test.support.patch(self, time, 'daylight', False) - t0 = datetime.datetime(1970, 1, 1, tzinfo = datetime.timezone.utc) + t0 = datetime.datetime(1990, 1, 1, tzinfo = datetime.timezone.utc) t1 = utils.localtime(t0) t2 = t0 - datetime.timedelta(hours=5) t2 = t2.replace(tzinfo = datetime.timezone(datetime.timedelta(hours=-5))) @@ -108,14 +108,14 @@ class LocaltimeTests(unittest.TestCase): def test_localtime_epoch_notz_daylight_true(self): test.support.patch(self, time, 'daylight', True) - t0 = datetime.datetime(1970, 1, 1) + t0 = datetime.datetime(1990, 1, 1) t1 = utils.localtime(t0) t2 = utils.localtime(t0.replace(tzinfo=None)) self.assertEqual(t1, t2) def test_localtime_epoch_notz_daylight_false(self): test.support.patch(self, time, 'daylight', False) - t0 = datetime.datetime(1970, 1, 1) + t0 = datetime.datetime(1990, 1, 1) t1 = utils.localtime(t0) t2 = utils.localtime(t0.replace(tzinfo=None)) self.assertEqual(t1, t2)