Author: Niclas Olofsson <n...@niclasolofsson.se> Branch: py3.3-exceptions Changeset: r78659:3cc1d9bd955c Date: 2015-07-25 13:58 +0200 http://bitbucket.org/pypy/pypy/changeset/3cc1d9bd955c/
Log: Fixed time.strptime test on Darwin. diff --git a/pypy/module/time/test/test_time.py b/pypy/module/time/test/test_time.py --- a/pypy/module/time/test/test_time.py +++ b/pypy/module/time/test/test_time.py @@ -248,8 +248,6 @@ raises(TypeError, time.strftime, ()) raises(TypeError, time.strftime, (1,)) raises(TypeError, time.strftime, range(8)) - exp = '0 01 01 00 00 00 1 001' - assert time.strftime("%Y %m %d %H %M %S %w %j", (0,)*9) == exp # Guard against invalid/non-supported format string # so that Python don't crash (Windows crashes when the format string @@ -260,8 +258,15 @@ # darwin strips % of unknown format codes # http://bugs.python.org/issue9811 assert time.strftime('%f') == 'f' + + # Darwin always use four digits for %Y, Linux uses as many as needed. + expected_year = '0000' else: assert time.strftime('%f') == '%f' + expected_year = '0' + + expected_formatted_date = expected_year + ' 01 01 00 00 00 1 001' + assert time.strftime("%Y %m %d %H %M %S %w %j", (0,) * 9) == expected_formatted_date def test_strftime_ext(self): import time _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit