Percentages don't align correctly
See original GitHub issueThis is a really petty issue, so please excuse it. I know it isn’t overly important compared to most issues here.
The percentages for execution logging do not align when there is a large number of tests being run. This leads to the lines of .
overflowing to the next line, which makes the graph become difficult to read.
I have had a poke around in the code, but I do not feel comfortable trying to fix this without more time to understand what the code is doing, unfortunately.
Thanks for taking the time to look into this, greatly appreciated, we rely on Pytest heavily in our project! 👍
This was for the following raw output:
............................................................................................ [ 3%]
............................................................................................ [ 6%]
............................................................................................ [ 9%]
............................................................................................ [ 13%]
............................................................................................ [ 16%]
............................................................................................ [ 19%]
............................................................................................ [ 23%]
............................................................................................ [ 26%]
............................................................................................ [ 29%]
............................................................................................ [ 33%]
............................................................................................ [ 36%]
............................................................................................ [ 39%]
............................................................................................ [ 43%]
............................................................................................. [ 46%]
............................................................................................. [ 49%]
............................................................................................ [ 53%]
............................................................................................ [ 56%]
............................................................................................ [ 59%]
............................................................................................ [ 63%]
............................................................................................. [ 66%]
............................................................................................. [ 69%]
............................................................................................ [ 73%]
............................................................................................. [ 76%]
............................................................................................ [ 79%]
............................................................................................ [ 83%]
............................................................................................ [ 86%]
............................................................................................ [ 89%]
............................................................................................ [ 93%]
............................................................................................ [ 96%]
............................................................................................ [ 99%]
.... [100%]
Coverage.py warning: No data was collected. (no-data-collected)
…for a total of 2,769 test cases, which leads me to think this is possibly a simple rounding issue somewhere.
Typeface: Jetbrains mono, but can repro on Droid Sans Mono and Fira Code Retina as well. The raw output suggests it isn’t an issue with fonts but an issue with the number of .
being printed – I haven’t bothered counting every single one yet. Can reproduce this on multiple terminals, such as the ones embedded in VSCode and IntelliJ IDEA.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
I’ve seen this as well with xdist.
It seems random unfortunately, I’ve seen it happen, and then running the same test suite again without changing anything, for the problem to disappear.
I suspect it is related to terminal character counting in
py
somehow.If I had to guess why this happens, it’d be that xdist issues e.g. the following sequence:
The way pytest works, it prints the
.
onpytest_runtest_logreport
, but only prints the\n
(if reached the edge of the terminal) onpytest_runtest_logfinish
.I haven’t verified this, maybe xdist does synchronize the runtest protocol between items and it’s something else anyway.