bpo-30283: Backport regrtest features from master to 2.7 by vstinner · Pull Request #1516 · python/cpython
Example of output, parallel mode:
haypo@selma$ ./python -m test -j8 -rW
== CPython 2.7.13+ (heads/regrtest_backport_27:d9324ab, May 9 2017, 15:09:11) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)]
== Linux-4.10.12-200.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five little-endian
== /home/haypo/prog/python/2.7/build/test_python_32262
Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0)
Using random seed 1313440
Run tests in parallel using 8 child processes
0:00:00 [ 1/402] test_getargs passed
0:00:00 [ 2/402] test_aepack skipped
test_aepack skipped -- No module named aetypes
0:00:00 [ 3/402] test_pipes passed
0:00:00 [ 4/402] test_stat passed
0:00:00 [ 5/402] test_pkgimport passed
0:00:00 [ 6/402] test_codeccallbacks passed
...
0:00:30 [119/402] test_syntax passed
0:00:30 [120/402] test_userstring passed -- running: test_io (30 sec)
0:00:30 [121/402] test_threading passed -- running: test_io (30 sec)
...
0:00:42 [180/402] test_isinstance passed -- running: test_io (43 sec)
0:00:42 [181/402] test_strop passed -- running: test_io (43 sec)
0:00:42 [182/402] test_zipfile64 skipped (resource denied) -- running: test_io (43 sec)
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
...
^C
...
Total duration: 53 sec
Tests result: INTERRUPTED
Another example of sequential run (test_sys modified to fail):
haypo@selma$ ./python -m test test_sys test_os
Run tests sequentially
0:00:00 [1/2] test_sys
test test_sys crashed -- <type 'exceptions.NameError'>: name 'x' is not defined
0:00:00 [2/2/1] test_os -- test_sys failed
[21657 refs]
[21657 refs]
1 test OK.
1 test failed:
test_sys
Total duration: 193 ms
Tests result: FAILURE