Commits

Victor Stinner committed 367e376

Close #15165: Fix test_email on Windows 64 bits

Use year 1990 instead of year 1970 to avoid issues with negative timestamps.

Comments (0)

Files changed (1)

Lib/test/test_email/test_utils.py

     @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)))
     @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)))
 
     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)