diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-17 22:39:21 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-17 22:39:21 (GMT) |
commit | 55329f8fbd7d4beb1483705f8a7bf1419e2eaba6 (patch) | |
tree | 9107ea9d0fb5cfa8c39f9ea433a31d5a423dadde /Lib | |
parent | b6e622d184604771088b5d2dd4f4cf0cddb2a3ae (diff) | |
download | cpython-55329f8fbd7d4beb1483705f8a7bf1419e2eaba6.zip cpython-55329f8fbd7d4beb1483705f8a7bf1419e2eaba6.tar.gz cpython-55329f8fbd7d4beb1483705f8a7bf1419e2eaba6.tar.bz2 |
Issue #19634: time.strftime("%y") now raises a ValueError on AIX when given a
year before 1900.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_strftime.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py index 61215a1..ff6274e 100644 --- a/Lib/test/test_strftime.py +++ b/Lib/test/test_strftime.py @@ -182,15 +182,13 @@ class Y1900Tests(unittest.TestCase): a date before 1900 is passed with a format string containing "%y" """ - @unittest.skipUnless(sys.platform == "win32", "Only applies to Windows") - def test_y_before_1900_win(self): - with self.assertRaises(ValueError): - time.strftime("%y", (1899, 1, 1, 0, 0, 0, 0, 0, 0)) - - @unittest.skipIf(sys.platform == "win32", "Doesn't apply on Windows") - def test_y_before_1900_nonwin(self): - self.assertEqual( - time.strftime("%y", (1899, 1, 1, 0, 0, 0, 0, 0, 0)), "99") + def test_y_before_1900(self): + t = (1899, 1, 1, 0, 0, 0, 0, 0, 0) + if sys.platform == "win32" or sys.platform.startswith("aix"): + with self.assertRaises(ValueError): + time.strftime("%y", t) + else: + self.assertEqual(time.strftime("%y", t), "99") def test_y_1900(self): self.assertEqual( |