-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
This is a proposal to change the terminal output while running tests to include the total tests ran so far and the total tests still to run, or percentage of the total tests executed so far.
Currently here's the normal pytest output (minus header):
============================= test session starts =============================
collected 1909 items
testing\acceptance_test.py ...............s................................x.............
testing\deprecated_test.py ......
testing\test_argcomplete.py ss
testing\test_assertion.py ........................................................................s.......
<snip>
What I propose is:
============================= test session starts ===============================
collected 1909 items
testing\acceptance_test.py ...............s............................ [44/1909]
....x............. [62/1909]
testing\deprecated_test.py ...... [68/1909]
testing\test_argcomplete.py ss [70/1909]
testing\test_assertion.py ............................................ [114/1909]
............................s....... [150/1909]
<snip>
This would be a better view of the overall progress and how much tests are still left on the run.
Alternatively instead of showing test counts we could just show a percentage of the total run so far:
============================= test session starts ===============================
collected 1909 items
testing\acceptance_test.py ...............s................................ [ 2%]
....x......... [ 3%]
testing\deprecated_test.py ...... [ 3%]
testing\test_argcomplete.py ss [ 3%]
testing\test_assertion.py ................................................. [ 5%]
............................s. [ 7%]
<snip>
Thoughts? cc @RonnyPfannschmidt @hpk42 @The-Compiler @hackebrot
Side note
This idea came to be because it Jenkins (it seems) only updates its console view when the process outputs a new line. When running with xdist, pytest only prints a .
per test, only printing a new line at the end of the session, so the output windows doesn't update until the end of the run.
Changing the output to the one proposed here would fix that and also provide a nice user experience (IMO).