Kaydet (Commit) 11f5c9e0 authored tarafından Georg Brandl's avatar Georg Brandl

Convert test failure from output-producing to self.fail().

üst fe6349c9
...@@ -118,16 +118,15 @@ class StrftimeTest(unittest.TestCase): ...@@ -118,16 +118,15 @@ class StrftimeTest(unittest.TestCase):
try: try:
result = time.strftime(e[0], now) result = time.strftime(e[0], now)
except ValueError, error: except ValueError, error:
print "Standard '%s' format gave error: %s" % (e[0], error) self.fail("strftime '%s' format gave error: %s" % (e[0], error))
continue
if re.match(escapestr(e[1], self.ampm), result): if re.match(escapestr(e[1], self.ampm), result):
continue continue
if not result or result[0] == '%': if not result or result[0] == '%':
print "Does not support standard '%s' format (%s)" % \ self.fail("strftime does not support standard '%s' format (%s)"
(e[0], e[2]) % (e[0], e[2]))
else: else:
print "Conflict for %s (%s):" % (e[0], e[2]) self.fail("Conflict for %s (%s): expected %s, but got %s"
print " Expected %s, but got %s" % (e[1], result) % (e[0], e[2], e[1], result))
def strftest2(self, now): def strftest2(self, now):
nowsecs = str(long(now))[:-1] nowsecs = str(long(now))[:-1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment