What's the meaning of the percentages displayed for each test on PyTest?

This is a makeshift progress bar.

It displays the "percentage of work" done so far -- most probably, total completed tests by the total number of tests to run (that it precalculated at the start).

If your tests ran for longer, you would probably see the number in the line changing as it crunches through the specific file.


It's one of the features included on Pytest, since version 3.3 (2017).

As my comrade @ivan_pozdeev mentioned, it's a progress indicator, indeed.

Here's an example, where you have 4 tests collected:

$ pytest test.py -v
================================ test session starts =============================
platform linux -- Python 3.6.7, pytest-4.4.0, py-1.8.0, pluggy-0.9.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/ivanleoncz/git/pysd
collected 4 items                                                                           
test.py::test_active_services PASSED                                        [ 25%]
test.py::test_enabled_services PASSED                                       [ 50%]
test.py::test_is_enabled PASSED                                             [ 75%]
test.py::test_is_active PASSED                                              [100%]

============================== 4 passed in 0.55 seconds ==========================
  • 100% of the tests / the amount of collected tests == a progression of 25%, from one test to another