Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2382)

Unified Diff: Lib/test/datetimetester.py

Issue 11930: Remove time.accept2dyear
Patch Set: Created 2 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/datetime.py ('k') | Modules/_datetimemodule.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -1289,12 +1289,9 @@ class TestDate(HarmlessMixedComparison,
self.assertTrue(self.theclass.min)
self.assertTrue(self.theclass.max)
- def test_strftime_out_of_range(self):
- # For nasty technical reasons, we can't handle years before 1000.
- cls = self.theclass
- self.assertEqual(cls(1000, 1, 1).strftime("%Y"), "1000")
- for y in 1, 49, 51, 99, 100, 999:
- self.assertRaises(ValueError, cls(y, 1, 1).strftime, "%Y")
+ def test_strftime_y2k(self):
+ for y in (1, 49, 70, 99, 100, 999, 1000, 1970):
+ self.assertEqual(self.theclass(y, 1, 1).strftime("%Y"), str(y))
def test_replace(self):
cls = self.theclass
« no previous file with comments | « Lib/datetime.py ('k') | Modules/_datetimemodule.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7