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

Method test_errored_directory

Lib/test/test_tabnanny.py:249–263  ·  view source on GitHub ↗

Directory containing wrongly indented python source code files.

(self)

Source from the content-addressed store, hash-verified

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