mirror of
https://github.com/python/cpython.git
synced 2025-08-15 06:10:47 +00:00
Merged revisions 68610,68621-68622,68649 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68610 | kristjan.jonsson | 2009-01-15 03:09:13 -0600 (Thu, 15 Jan 2009) | 3 lines Fix recently introduced test cases. For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash. For test_os, two cases were incorrect. ........ r68621 | kristjan.jonsson | 2009-01-15 16:40:03 -0600 (Thu, 15 Jan 2009) | 1 line Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor. ........ r68622 | kristjan.jonsson | 2009-01-15 16:46:26 -0600 (Thu, 15 Jan 2009) | 1 line Make all the invalid fd tests for os subject to the function being available. ........ r68649 | benjamin.peterson | 2009-01-16 22:39:05 -0600 (Fri, 16 Jan 2009) | 1 line trying to find some fpathconf() settings that all unixs support... ........
This commit is contained in:
parent
945fdd6e6d
commit
f5def21ce7
2 changed files with 31 additions and 13 deletions
|
@ -857,9 +857,18 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
|
|||
self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
|
||||
|
||||
#make sure that invalid format specifiers are handled correctly
|
||||
self.assertRaises(ValueError, t.strftime, "%e")
|
||||
self.assertRaises(ValueError, t.strftime, "%")
|
||||
self.assertRaises(ValueError, t.strftime, "%#")
|
||||
#self.assertRaises(ValueError, t.strftime, "%e")
|
||||
#self.assertRaises(ValueError, t.strftime, "%")
|
||||
#self.assertRaises(ValueError, t.strftime, "%#")
|
||||
|
||||
#oh well, some systems just ignore those invalid ones.
|
||||
#at least, excercise them to make sure that no crashes
|
||||
#are generated
|
||||
for f in ["%e", "%", "%#"]:
|
||||
try:
|
||||
t.strftime(f)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
#check that this standard extension works
|
||||
t.strftime("%f")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue