MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_when_wrong_indented

Method test_when_wrong_indented

Lib/test/test_tabnanny.py:203–210  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

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