question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Percentages don't align correctly

See original GitHub issue

This 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! 👍

image

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:open
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoddemuscommented, May 5, 2020

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.

0reactions
bluetechcommented, Jul 5, 2021

If I had to guess why this happens, it’d be that xdist issues e.g. the following sequence:

  • pytest_runtest_logreport (of worker 1)
  • pytest_runtest_logreport (of worker 2)
  • pytest_runtest_logfinish (of worker 1)
  • pytest_runtest_logfinish (of worker 2)

The way pytest works, it prints the . on pytest_runtest_logreport, but only prints the \n (if reached the edge of the terminal) on pytest_runtest_logfinish.

I haven’t verified this, maybe xdist does synchronize the runtest protocol between items and it’s something else anyway.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Percentage Alignment Issue - html - Stack Overflow
See the two examples below: Not working codepen - Unevenly aligned with correct widths. Aligned codepen - Evenly aligned with incorrect widths.
Read more >
Excel refuses to align a number left or centre - AuditExcel
As shown below, highlight the cells where the Excel numbers won't left or centre align and: go to Format Cells,; Click on Custom,;...
Read more >
Excel refuses to align a number left or center - YouTube
00:00 Number vs Currency vs Accounting Format - left aligned ... where the Excel numbers won't left or centre align and: go to...
Read more >
alignment with decimals & % sign - ExcelBanter
I cannot align columns of numbers the way I want. ... after row 1, the row with the percent, are whole numbers -...
Read more >
y-axis values on graph don't align with values in Plot Area
I'm making a graph in Word (where I edit the data in Excel), but the values on the y-axis don't correspond with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found