diff options
Diffstat (limited to 'Lib/test/test_datetime.py')
| -rw-r--r-- | Lib/test/test_datetime.py | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index ff00d8b..89fa5c8 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -856,6 +856,14 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):          # A naive object replaces %z and %Z w/ empty strings.          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, "%#") + +        #check that this standard extension works +        t.strftime("%f") +      def test_format(self):          dt = self.theclass(2007, 9, 10)  | 
