I have pytest running with pytest-sugar. For a couple of long running tests I'd like to use progress bars. Unfortunately, pytest-sugar doesn't terminate the lines, in order to keep adding to the same line. When the progress bar starts, the last line is overwritten. See the following code for a demonstrator. Is there some better way, to detect if the last line in the terminal is not terminated, so that the bar would start in its own line, while pytest output keeps untouched?
from rich.progress import track
print("unterminated line", end="") # this line gets overwritten in the output
list(track(range(10)))
I have pytest running with pytest-sugar. For a couple of long running tests I'd like to use progress bars. Unfortunately, pytest-sugar doesn't terminate the lines, in order to keep adding to the same line. When the progress bar starts, the last line is overwritten. See the following code for a demonstrator. Is there some better way, to detect if the last line in the terminal is not terminated, so that the bar would start in its own line, while pytest output keeps untouched?