diff --git a/src/lob_hlpr/hlpr.py b/src/lob_hlpr/hlpr.py index 2fb976b..b56e376 100644 --- a/src/lob_hlpr/hlpr.py +++ b/src/lob_hlpr/hlpr.py @@ -136,7 +136,6 @@ def lob_print(log_path: str, *args, **kwargs): """ color = kwargs.pop("color", None) sep = kwargs.pop("sep", " ") - kwargs.pop("end", None) # consumed by print, not meaningful for logging LobHlpr._print_color(*args, color=color, sep=sep, **kwargs) # get the directory from the log_path diff --git a/tests/test_lob_hlpr.py b/tests/test_lob_hlpr.py index 769489a..7d190e1 100644 --- a/tests/test_lob_hlpr.py +++ b/tests/test_lob_hlpr.py @@ -188,6 +188,14 @@ def test_log_print_multiline(tmp_path, capsys): assert not any("\n" in ln for ln in log_lines) +@pytest.mark.parametrize("color", [None, "red"]) +def test_log_print_end(tmp_path, capsys, color): + """The end keyword reaches print, with and without color.""" + test_file = tmp_path / "end.log" + hlp.lob_print(str(test_file), "no newline", end="", color=color) + assert not capsys.readouterr().out.endswith("\n") + + def test_log_print_concurrent(tmp_path): """lob_print is safe to call from multiple threads simultaneously.