1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] How can I get the accurate time spent in the pytest-html report when the tests are...

Discussão em 'Python' iniciado por Stack, Setembro 16, 2025.

  1. Stack

    Stack Membro Participativo

    I've noticed an error in the report generated by pytest-html and I'm surprised I can't find it mentioned anywhere.

    I am running a series of tests (70 total) and using pytest-html to generate a report on the results. I am also using pytest-xdist so that the tests run in parallel.

    When the test run is complete, I look at the terminal to how long it took for everything and see:

    2 failed, 68 passed in 146.09s (0:02:26)


    These are UI tests so two and a half minutes isn't that bad; also it's why these need to be run in parallel.

    But when I look at the pytest-html report, it says:

    70 tests took 00:23:32.


    The report doesn't look at the actual start and finish time. It's using the times of each of the tests and summing them together.

    How can I update the report to show the real time spent, not the total of the individual tests?

    Continue reading...

Compartilhe esta Página