mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
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.
This commit is contained in:
parent
018760e3dc
commit
8adc0b54d4
2 changed files with 14 additions and 5 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