MCPcopy Create free account
hub / github.com/python/mypy / test_config_file_error_codes

Method test_config_file_error_codes

mypy/test/teststubtest.py:3193–3204  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3191 assert output == "Success: no issues found in 1 module\n"
3192
3193 def test_config_file_error_codes(self) -> None:
3194 runtime = "temp = 5\n"
3195 stub = "temp = SOME_GLOBAL_CONST"
3196 output = run_stubtest(stub=stub, runtime=runtime, options=[])
3197 assert output == (
3198 "error: not checking stubs due to mypy build errors:\n"
3199 'test_module.pyi:1: error: Name "SOME_GLOBAL_CONST" is not defined [name-defined]\n'
3200 )
3201
3202 config_file = "[mypy]\ndisable_error_code = name-defined\n"
3203 output = run_stubtest(stub=stub, runtime=runtime, options=[], config_file=config_file)
3204 assert output == "Success: no issues found in 1 module\n"
3205
3206 def test_config_file_error_codes_invalid(self) -> None:
3207 runtime = "temp = 5\n"

Callers

nothing calls this directly

Calls 1

run_stubtestFunction · 0.85

Tested by

no test coverage detected