jeffwright13 / pytest-fold

A Pytest plugin to make console output more manageable when there are multiple failed tests
MIT License
12 stars 2 forks source link

Fix text-overflow issues #46

Closed jeffwright13 closed 2 years ago

jeffwright13 commented 2 years ago

Pytest formats its output at the width of the terminal at the time when it was run. Since the TUI is launched automatically within that same terminal, the resulting area in which Pytest's output is rendered is a few characters less wide than the raw Pytest output (frames/windows/widgets take up a few spaces for their borders).

We need a way to show Pytest's output line strings at the width of the rendering widget, not the native terminal width.

Module https://docs.python.org/3/library/textwrap.html#module-textwrap looks promising...?

jeffwright13 commented 2 years ago

Textual seems to accomodate this dynamically. PyTermTk has an override-able border method on its widgets that I have used to get it to within 2 chars of max width - which is visually close enough for now. :-)