]> granicus.if.org Git - python/commitdiff
Use assertEqual in test_strptime for better failure messages (cf. issue #14113).
authorNadeem Vawda <nadeem.vawda@gmail.com>
Sat, 25 Feb 2012 13:58:36 +0000 (15:58 +0200)
committerNadeem Vawda <nadeem.vawda@gmail.com>
Sat, 25 Feb 2012 13:58:36 +0000 (15:58 +0200)
Lib/test/test_strptime.py

index 89c08ede7b5da6c270c760610c3d94cc6a9e2eb2..5332f2be69123628aa3f260da6e31015c10ab8d0 100644 (file)
@@ -86,17 +86,14 @@ class LocaleTime_Tests(unittest.TestCase):
         #  output.
         magic_date = (1999, 3, 17, 22, 44, 55, 2, 76, 0)
         strftime_output = time.strftime("%c", magic_date)
-        self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_date_time,
-                                                         magic_date),
-                        "LC_date_time incorrect")
+        self.assertEqual(time.strftime(self.LT_ins.LC_date_time, magic_date),
+                         strftime_output, "LC_date_time incorrect")
         strftime_output = time.strftime("%x", magic_date)
-        self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_date,
-                                                         magic_date),
-                        "LC_date incorrect")
+        self.assertEqual(time.strftime(self.LT_ins.LC_date, magic_date),
+                         strftime_output, "LC_date incorrect")
         strftime_output = time.strftime("%X", magic_date)
-        self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_time,
-                                                         magic_date),
-                        "LC_time incorrect")
+        self.assertEqual(time.strftime(self.LT_ins.LC_time, magic_date),
+                         strftime_output, "LC_time incorrect")
         LT = _strptime.LocaleTime()
         LT.am_pm = ('', '')
         self.assertTrue(LT.LC_time, "LocaleTime's LC directives cannot handle "