]> granicus.if.org Git - python/commitdiff
closes bpo-34654: Tolerate + at the beginning of large years. (GH-9238)
authorBenjamin Peterson <benjamin@python.org>
Wed, 12 Sep 2018 23:21:36 +0000 (16:21 -0700)
committerGitHub <noreply@github.com>
Wed, 12 Sep 2018 23:21:36 +0000 (16:21 -0700)
Lib/test/test_time.py

index 9acd1d497ee8924c82e2828c3c3ad5a8072b57ce..62abd891aafa6273b90657889c9bab5efe9afbac 100644 (file)
@@ -703,9 +703,9 @@ class _Test4dYear:
         self.assertEqual(func(9999), fmt % 9999)
 
     def test_large_year(self):
-        self.assertEqual(self.yearstr(12345), '12345')
-        self.assertEqual(self.yearstr(123456789), '123456789')
-        self.assertEqual(self.yearstr(TIME_MAXYEAR), str(TIME_MAXYEAR))
+        self.assertEqual(self.yearstr(12345).lstrip('+'), '12345')
+        self.assertEqual(self.yearstr(123456789).lstrip('+'), '123456789')
+        self.assertEqual(self.yearstr(TIME_MAXYEAR).lstrip('+'), str(TIME_MAXYEAR))
         self.assertRaises(OverflowError, self.yearstr, TIME_MAXYEAR + 1)
 
     def test_negative(self):