Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/lob_hlpr/hlpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/test_lob_hlpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down