This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: regrtest: display the current number of failures
Type: Stage: resolved
Components: Tests Versions: Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, ezio.melotti, python-dev, r.david.murray, vstinner
Priority: normal Keywords: patch

Created on 2011-05-13 23:15 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
regrtest_failures.patch vstinner, 2011-05-13 23:15 review
Messages (8)
msg135949 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-05-13 23:15
The full test suite has something like 354 tests. regrtest writes one line per test, and if you use Python compiled in debug mode you have much more lines because of "[123 refs]" lines written by subprocesses.

It's difficult to check if a previous test failed or not. If your terminal has a small backlog (e.g. 200 lines), it is maybe just not possible to know. In buildbot logs, it is also hard to search the first failure because the log is very verbose.

Attached patch adds " -- 1 failure" suffix after the first failure. If you use the -j option, the number of failure is written directly (because the test name is only printed after the test is done). By default, the counter is incremented *after* the failure.

--

Example (I modified test_os to ensure that it fails):

marge$ ./python -m test test_os test_sys test_os test_sys
[1/4] test_os
test test_os crashed -- Traceback (most recent call last):
  File "/home/haypo/prog/HG/cpython/Lib/test/regrtest.py", line 1047, in runtest_inner
    the_package = __import__(abstest, globals(), locals(), [])
  File "/home/haypo/prog/HG/cpython/Lib/test/test_os.py", line 5, in <module>
    assert 1 == 0
AssertionError

[2/4] test_sys -- 1 failure
[37703 refs]
[37701 refs]
[37954 refs]
[37919 refs]
[3/4] test_os -- 1 failure
test test_os crashed -- Traceback (most recent call last):
  File "/home/haypo/prog/HG/cpython/Lib/test/regrtest.py", line 1047, in runtest_inner
    the_package = __import__(abstest, globals(), locals(), [])
  File "/home/haypo/prog/HG/cpython/Lib/test/test_os.py", line 5, in <module>
    assert 1 == 0
AssertionError

[4/4] test_sys -- 2 failures
[37703 refs]
[37701 refs]
[37954 refs]
[37919 refs]
2 tests OK.
1 test failed:
    test_os
[98160 refs]
msg135950 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-05-13 23:17
See also issue #12073.
msg136656 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-23 14:58
+1 on the idea.
msg136680 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-05-23 16:47
How about instead changing [1/4], [2/4] etc to be [1/4/0], [2/4/0], etc?
msg136695 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-23 21:16
New changeset 2da7577fa393 by Victor Stinner in branch '3.2':
Issue #12074: regrtest displays also the current number of failures
http://hg.python.org/cpython/rev/2da7577fa393

New changeset 60b0131fbea8 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #12074: regrtest displays also the current number of failures
http://hg.python.org/cpython/rev/60b0131fbea8
msg136697 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-05-23 21:16
> How about instead changing [1/4], [2/4] etc 
> to be [1/4/0], [2/4/0], etc?

Great, I like it, and it's commited.
msg136702 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-23 22:04
New changeset 396f4ed61db7 by Ezio Melotti in branch '3.2':
#12074: remove the /0 when there are no failures.
http://hg.python.org/cpython/rev/396f4ed61db7

New changeset 9de2b1a5ee6b by Ezio Melotti in branch 'default':
#12074: merge with 3.2.
http://hg.python.org/cpython/rev/9de2b1a5ee6b
msg136704 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-05-23 22:07
I removed the /0 when there are no failures after a short discussion on #python-dev.  FWIW I'm -0 on the /N, but now that it's not displayed if there are no failures it won't bother me too much.
History
Date User Action Args
2022-04-11 14:57:17adminsetgithub: 56283
2011-05-23 22:07:03ezio.melottisetversions: + Python 3.2
nosy: + ezio.melotti

messages: + msg136704

stage: resolved
2011-05-23 22:04:16python-devsetmessages: + msg136702
2011-05-23 21:16:59vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg136697
2011-05-23 21:16:11python-devsetnosy: + python-dev
messages: + msg136695
2011-05-23 16:47:46r.david.murraysetnosy: + r.david.murray
messages: + msg136680
2011-05-23 14:58:56eric.araujosetnosy: + eric.araujo
messages: + msg136656
2011-05-13 23:17:48vstinnersetmessages: + msg135950
2011-05-13 23:15:55vstinnercreate