MCPcopy Create free account
hub / github.com/numpy/numpy / test_extended_precision

Function test_extended_precision

numpy/typing/tests/test_typing.py:283–300  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

281@pytest.mark.slow
282@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed")
283def test_extended_precision() -> None:
284 path = os.path.join(MISC_DIR, "extended_precision.pyi")
285 output_mypy = OUTPUT_MYPY
286 assert path in output_mypy
287
288 with open(path) as f:
289 expression_list = f.readlines()
290
291 for _msg in output_mypy[path]:
292 lineno, msg = _strip_filename(_msg)
293 expression = expression_list[lineno - 1].rstrip("\n")
294
295 if LINENO_MAPPING[lineno] in _EXTENDED_PRECISION_LIST:
296 raise AssertionError(_REVEAL_MSG.format(lineno, msg))
297 elif "error" not in msg:
298 _test_fail(
299 path, expression, msg, 'Expression is of type "Any"', lineno
300 )

Callers

nothing calls this directly

Calls 5

openFunction · 0.85
_strip_filenameFunction · 0.85
_test_failFunction · 0.85
rstripMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected