[Python-checkins] closes bpo-34654: Tolerate + at the beginning of large years. (GH-9238)

Benjamin Peterson webhook-mailer at python.org
Wed Sep 12 19:21:42 EDT 2018


https://github.com/python/cpython/commit/e1a34ceb541ef87e03bb428630097dacc9c658e5
commit: e1a34ceb541ef87e03bb428630097dacc9c658e5
branch: master
author: Benjamin Peterson <benjamin at python.org>
committer: GitHub <noreply at github.com>
date: 2018年09月12日T16:21:36-07:00
summary:
closes bpo-34654: Tolerate + at the beginning of large years. (GH-9238)
files:
M Lib/test/test_time.py
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 9acd1d497ee8..62abd891aafa 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -703,9 +703,9 @@ def test_year(self, fmt=None, func=None):
 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):


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /