diff options
author | Georg Brandl <georg@python.org> | 2010-02-08 22:48:37 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-02-08 22:48:37 (GMT) |
commit | 11f5c9e0011cfa2a9435a9c7b5c9870421310051 (patch) | |
tree | 9d123ee78a77a360b283fe1933d299e7841bc5a8 | |
parent | fe6349c96505d874ed68eb85e61a833bb6a858af (diff) | |
download | cpython-11f5c9e0011cfa2a9435a9c7b5c9870421310051.zip cpython-11f5c9e0011cfa2a9435a9c7b5c9870421310051.tar.gz cpython-11f5c9e0011cfa2a9435a9c7b5c9870421310051.tar.bz2 |
Convert test failure from output-producing to self.fail().
-rwxr-xr-x | Lib/test/test_strftime.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py index 5043bfa..b26ebec 100755 --- a/Lib/test/test_strftime.py +++ b/Lib/test/test_strftime.py @@ -118,16 +118,15 @@ class StrftimeTest(unittest.TestCase): try: result = time.strftime(e[0], now) except ValueError, error: - print "Standard '%s' format gave error: %s" % (e[0], error) - continue + self.fail("strftime '%s' format gave error: %s" % (e[0], error)) if re.match(escapestr(e[1], self.ampm), result): continue if not result or result[0] == '%': - print "Does not support standard '%s' format (%s)" % \ - (e[0], e[2]) + self.fail("strftime does not support standard '%s' format (%s)" + % (e[0], e[2])) else: - print "Conflict for %s (%s):" % (e[0], e[2]) - print " Expected %s, but got %s" % (e[1], result) + self.fail("Conflict for %s (%s): expected %s, but got %s" + % (e[0], e[2], e[1], result)) def strftest2(self, now): nowsecs = str(long(now))[:-1] |