[Python-checkins] r78117 - python/trunk/Lib/test/test_strftime.py

georg.brandl python-checkins at python.org
Mon Feb 8 23:48:37 CET 2010


Author: georg.brandl
Date: Mon Feb  8 23:48:37 2010
New Revision: 78117

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

Modified:
   python/trunk/Lib/test/test_strftime.py

Modified: python/trunk/Lib/test/test_strftime.py
==============================================================================
--- python/trunk/Lib/test/test_strftime.py	(original)
+++ python/trunk/Lib/test/test_strftime.py	Mon Feb  8 23:48:37 2010
@@ -118,16 +118,15 @@
             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]


More information about the Python-checkins mailing list