(func_name)
| 22 | |
| 23 | @pytest.mark.parametrize("func_name", ["error", "warn", "info", "debug"]) |
| 24 | def 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}" |
nothing calls this directly
no test coverage detected