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
2 changes: 1 addition & 1 deletion src/usethis/_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def plain_print(msg: str | Exception) -> None:
or usethis_config.alert_only
or usethis_config.instruct_only
):
console.print(msg)
Console(force_terminal=False, soft_wrap=True).print(msg)


def table_print(table: Table) -> None:
Expand Down
11 changes: 11 additions & 0 deletions tests/usethis/test_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ def test_out(self, capfd: pytest.CaptureFixture[str]) -> None:
out, _ = capfd.readouterr()
assert out == "Hello\n"

def test_no_line_wrapping(self, capfd: pytest.CaptureFixture[str]) -> None:
# Arrange
long_msg = "A" * 100

# Act
plain_print(long_msg)

# Assert
out, _ = capfd.readouterr()
assert out == f"{long_msg}\n"


class TestTablePrint:
def test_out(self, capfd: pytest.CaptureFixture[str]) -> None:
Expand Down