Commits

Philip Jenvey committed 1007f01

the caret location is an impl detail (reapplied from 2.7)

  • Participants
  • Parent commits f722b05
  • Branches py3k

Comments (0)

Files changed (1)

lib-python/3.2/test/test_traceback.py

 import re
 from test.support import run_unittest, Error, captured_output
 from test.support import TESTFN, unlink
+from test.support import check_impl_detail
 
 import traceback
 
                                         IndentationError)
         self.assertEqual(len(err), 4)
         self.assertEqual(err[1].strip(), "print(2)")
-        self.assertIn("^", err[2])
-        self.assertEqual(err[1].find(")"), err[2].find("^"))
+        if check_impl_detail():
+            # on CPython, there is a "^" at the end of the line on PyPy,
+            # there is a "^" too, but at the start, more logically
+            self.assertIn("^", err[2])
+            self.assertEqual(err[1].find(")"), err[2].find("^"))
 
     def test_base_exception(self):
         # Test that exceptions derived from BaseException are formatted right