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

Method test_when_nannynag_error_verbose

Lib/test/test_tabnanny.py:219–230  ·  view source on GitHub ↗

A python source code file eligible for raising `tabnanny.NannyNag`. Tests will assert `stdout` after activating `tabnanny.verbose` mode.

(self)

Source from the content-addressed store, hash-verified

217 self.verify_tabnanny_check(file_path, err=err)
218
219 def test_when_nannynag_error_verbose(self):
220 """A python source code file eligible for raising `tabnanny.NannyNag`.
221
222 Tests will assert `stdout` after activating `tabnanny.verbose` mode.
223 """
224 with TemporaryPyFile(SOURCE_CODES["nannynag_errored"]) as file_path:
225 out = f"{file_path!r}: *** Line 3: trouble in tab city! ***\n"
226 out += "offending line: '\\tprint(\"world\")'\n"
227 out += "inconsistent use of tabs and spaces in indentation\n"
228
229 tabnanny.verbose = 1
230 self.verify_tabnanny_check(file_path, out=out)
231
232 def test_when_nannynag_error(self):
233 """A python source code file eligible for raising `tabnanny.NannyNag`."""

Callers

nothing calls this directly

Calls 2

verify_tabnanny_checkMethod · 0.95
TemporaryPyFileClass · 0.85

Tested by

no test coverage detected