[New-bugs-announce] [issue12074] regrtest: display the current number of failures

STINNER Victor report at bugs.python.org
Sat May 14 01:16:00 CEST 2011


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

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]

----------
components: Tests
files: regrtest_failures.patch
keywords: patch
messages: 135949
nosy: haypo
priority: normal
severity: normal
status: open
title: regrtest: display the current number of failures
versions: Python 3.3
Added file: http://bugs.python.org/file21996/regrtest_failures.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12074>
_______________________________________


More information about the New-bugs-announce mailing list