]> Devi Nivas Git - chevron.git/commitdiff
Fix unittest in python 2.6
authorNoah Morrison <noah@morrison.ph>
Mon, 3 Jul 2017 16:44:28 +0000 (12:44 -0400)
committerNoah Morrison <noah@morrison.ph>
Mon, 3 Jul 2017 16:44:28 +0000 (12:44 -0400)
test_spec.py

index a02819eb13b26df10092de491adbb42911b2bbfe..4e043f3c38420fe48bdcbef7241b5b5fa86d6132 100755 (executable)
@@ -208,15 +208,12 @@ class ExpandedCoverage(unittest.TestCase):
             'data': {'foo': 'xx'}
         }
 
-        self.assertRaisesRegexp(chevron.ChevronError,
-                                'unclosed tag at line 3',
-                                chevron.render, **args)
-        self.assertRaisesRegexp(chevron.ChevronError,
-                                'unclosed tag at line 3',
-                                chevron.render, **args)
-        self.assertRaisesRegexp(chevron.ChevronError,
-                                'unclosed tag at line 3',
-                                chevron.render, **args)
+        # self.assertRaisesRegex does not exist in python2.6
+        for _ in range(10):
+            try:
+                chevron.render(**args)
+            except chevron.ChevronError as error:
+                self.assertEqual(error.msg, 'unclosed tag at line 3')
 
 
 # Run unit tests from command line