diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-08 02:46:33 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-08 02:46:33 (GMT) |
commit | af5aee57c98d4529218c517ee6d73c3f78bc6738 (patch) | |
tree | 79e20a7d0433de2292f3b5a6c089567f901c4a9e /Lib/test/test_time.py | |
parent | 736913269e19d4ac8bcf154921783554456ea681 (diff) | |
download | cpython-af5aee57c98d4529218c517ee6d73c3f78bc6738.zip cpython-af5aee57c98d4529218c517ee6d73c3f78bc6738.tar.gz cpython-af5aee57c98d4529218c517ee6d73c3f78bc6738.tar.bz2 |
Issue #1777412: fix test_time for Mac OS X and OpenIndiana
Diffstat (limited to 'Lib/test/test_time.py')
-rw-r--r-- | Lib/test/test_time.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 3db25bb..9f36c9d 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -293,17 +293,22 @@ class _TestStrftimeYear: try: text = self.yearstr(12345) except ValueError: - # If Python is compiled with Visual Studio, - # year is limited to [1; 9999] + # strftime() is limited to [1; 9999] with Visual Studio pass else: - self.assertEqual(text, '12345') + # Issue #10864: OpenIndiana is limited to 4 digits, but Python + # doesn't raise a ValueError + #self.assertEqual(text, '12345') + self.assertIn(text, ('2345', '12345')) try: text = self.yearstr(123456789) except ValueError: pass else: - self.assertEqual(text, '123456789') + # Issue #10864: OpenIndiana is limited to 4 digits, but Python + # doesn't raise a ValueError + #self.assertEqual(text, '123456789') + self.assertIn(text, ('123456789', '6789')) class _Test2dYear(_BaseYearTest): accept2dyear = 1 @@ -324,11 +329,11 @@ class _Test4dYear(_BaseYearTest): accept2dyear = 0 def test_year(self): - self.assertEqual(self.yearstr(1), '1') - self.assertEqual(self.yearstr(69), '69') - self.assertEqual(self.yearstr(68), '68') - self.assertEqual(self.yearstr(99), '99') - self.assertEqual(self.yearstr(999), '999') + self.assertIn(self.yearstr(1), ('1', '0001')) + self.assertIn(self.yearstr(68), ('68', '0068')) + self.assertIn(self.yearstr(69), ('69', '0069')) + self.assertIn(self.yearstr(99), ('99', '0099')) + self.assertIn(self.yearstr(999), ('999', '0999')) self.assertEqual(self.yearstr(9999), '9999') class TestAsctimeAccept2dYear(_TestAsctimeYear, _Test2dYear): |