MCPcopy Index your code
hub / github.com/python/cpython / test_caret_wide_char

Method test_caret_wide_char

Lib/test/test_traceback.py:137–149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

135 self.assertEqual(err[2].count("^"), 1)
136
137 def test_caret_wide_char(self):
138 err = self.get_exception_format(self.syntax_error_with_caret_wide_char,
139 SyntaxError)
140 self.assertIn("^", err[2])
141 # "女女女=1; 女女女/" has display width 17
142 self.assertEqual(err[2].find("^"), 4 + 17)
143
144 err = self.get_exception_format(self.syntax_error_with_caret_wide_char_range,
145 SyntaxError)
146 self.assertIn("^", err[2])
147 self.assertEqual(err[2].find("^"), 4 + 5)
148 # "女女女 for 女女女 in range(30)" has display width 30
149 self.assertEqual(err[2].count("^"), 30)
150
151 def test_nocaret(self):
152 exc = SyntaxError("error", ("x.py", 23, None, "bad syntax"))

Callers

nothing calls this directly

Calls 5

get_exception_formatMethod · 0.95
assertInMethod · 0.80
assertEqualMethod · 0.45
findMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected