MCPcopy
hub / github.com/python/mypy / test_only_py

Method test_only_py

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

Source from the content-addressed store, hash-verified

3117 )
3118
3119 def test_only_py(self) -> None:
3120 # in this case, stubtest will check the py against itself
3121 # this is useful to support packages with a mix of stubs and inline types
3122 with use_tmp_dir(TEST_MODULE_NAME):
3123 with open(f"{TEST_MODULE_NAME}.py", "w") as f:
3124 f.write("a = 1")
3125 output = io.StringIO()
3126 with contextlib.redirect_stdout(output):
3127 test_stubs(parse_options([TEST_MODULE_NAME]))
3128 output_str = remove_color_code(output.getvalue())
3129 assert output_str == "Success: no issues found in 1 module\n"
3130
3131 def test_get_typeshed_stdlib_modules(self) -> None:
3132 stdlib = mypy.stubtest.get_typeshed_stdlib_modules(None, (3, 7))

Callers

nothing calls this directly

Calls 5

test_stubsFunction · 0.90
parse_optionsFunction · 0.90
use_tmp_dirFunction · 0.85
remove_color_codeFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected