def test_ValueError(self):
        # Make sure ValueError is raised when match fails or format is bad
        self.assertRaises(ValueError, _strptime.strptime, data_string="%d",
                          format="%A")
        for bad_format in ("%", "% ", "%e"):
            try:
                _strptime.strptime("2005", bad_format)
            except ValueError:
                continue
            except Exception, err:
                self.fail("'%s' raised %s, not ValueError" %
                            (bad_format, err.__class__.__name__))
            else:
                self.fail("'%s' did not raise ValueError" % bad_format)
dataset/ETHPy150Open babble/babble/include/jython/Lib/test/test_strptime.py/StrptimeTests.test_ValueError/original