MCPcopy
hub / github.com/numpy/numpy / test_pass

Function test_pass

numpy/typing/tests/test_typing.py:142–159  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

140@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed")
141@pytest.mark.parametrize("path", get_test_cases(PASS_DIR, FAIL_DIR))
142def test_pass(path) -> None:
143 # Alias `OUTPUT_MYPY` so that it appears in the local namespace
144 output_mypy = OUTPUT_MYPY
145
146 if path not in output_mypy:
147 return
148
149 relpath = os.path.relpath(path)
150
151 # collect any reported errors, and clean up the output
152 messages = []
153 for message in output_mypy[path]:
154 lineno, content = _strip_filename(message)
155 content = content.removeprefix("error:").lstrip()
156 messages.append(f"{relpath}:{lineno} - {content}")
157
158 if messages:
159 pytest.fail("\n".join(messages), pytrace=False)
160
161
162@pytest.mark.slow

Callers

nothing calls this directly

Calls 4

_strip_filenameFunction · 0.85
lstripMethod · 0.80
joinMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…