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

Function test_log_prefix

numpy/distutils/tests/test_log.py:24–34  ·  view source on GitHub ↗
(func_name)

Source from the content-addressed store, hash-verified

22
23@pytest.mark.parametrize("func_name", ["error", "warn", "info", "debug"])
24def test_log_prefix(func_name):
25 func = getattr(log, func_name)
26 msg = f"{func_name} message"
27 f = io.StringIO()
28 with redirect_stdout(f):
29 func(msg)
30 out = f.getvalue()
31 assert out # sanity check
32 clean_out = r_ansi.sub("", out)
33 line = next(line for line in clean_out.splitlines())
34 assert line == f"{func_name.upper()}: {msg}"

Callers

nothing calls this directly

Calls 5

redirect_stdoutClass · 0.85
splitlinesMethod · 0.80
upperMethod · 0.80
funcFunction · 0.50
nextFunction · 0.50

Tested by

no test coverage detected