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

Method test_errored_directory

Lib/test/test_tabnanny.py:246–260  ·  view source on GitHub ↗

Directory containing wrongly indented python source code files.

(self)

Source from the content-addressed store, hash-verified

244 self.verify_tabnanny_check(path, err=err)
245
246 def test_errored_directory(self):
247 """Directory containing wrongly indented python source code files."""
248 with tempfile.TemporaryDirectory() as tmp_dir:
249 error_file = TemporaryPyFile(
250 SOURCE_CODES["wrong_indented"], directory=tmp_dir
251 )
252 code_file = TemporaryPyFile(
253 SOURCE_CODES["error_free"], directory=tmp_dir
254 )
255 with error_file as e_file, code_file as c_file:
256 err = ('unindent does not match any outer indentation level'
257 ' (<tokenize>, line 3)\n')
258 err = f"{e_file!r}: Indentation Error: {err}"
259 with self.assertRaises(SystemExit):
260 self.verify_tabnanny_check(tmp_dir, err=err)
261
262
263class TestProcessTokens(TestCase):

Callers

nothing calls this directly

Calls 3

verify_tabnanny_checkMethod · 0.95
TemporaryPyFileClass · 0.85
assertRaisesMethod · 0.45

Tested by

no test coverage detected