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

Method test_when_wrong_indented

Lib/test/test_tabnanny.py:202–209  ·  view source on GitHub ↗

A python source code file eligible for raising `IndentationError`.

(self)

Source from the content-addressed store, hash-verified

200 self.verify_tabnanny_check(tmp_dir)
201
202 def test_when_wrong_indented(self):
203 """A python source code file eligible for raising `IndentationError`."""
204 with TemporaryPyFile(SOURCE_CODES["wrong_indented"]) as file_path:
205 err = ('unindent does not match any outer indentation level'
206 ' (<tokenize>, line 3)\n')
207 err = f"{file_path!r}: Indentation Error: {err}"
208 with self.assertRaises(SystemExit):
209 self.verify_tabnanny_check(file_path, err=err)
210
211 def test_when_tokenize_tokenerror(self):
212 """A python source code file eligible for raising 'tokenize.TokenError'."""

Callers

nothing calls this directly

Calls 3

verify_tabnanny_checkMethod · 0.95
TemporaryPyFileClass · 0.85
assertRaisesMethod · 0.45

Tested by

no test coverage detected