[issue30523] unittest: add --list-tests option to only display the list of test names, don't run tests
Julien Palard
report at bugs.python.org
Sat Jun 3 12:42:05 EDT 2017
Julien Palard added the comment:
It works in "discover" mode, I tested:
./python -m unittest discover ./Lib/unittest/test/ --list-tests
and it worked.
So maybe the --list-tests should be moved to _getDiscoveryArgParser?
Also spotted that tests are printed on stderr, typically when the users asks for something, it has to be printed to stdout. Typically usages are written on stderr in case of error, but on stdout when explicitly asked via --help, see:
$ ./python -m unittest discover ./Lib/unittest/test/ --tabayo | wc
usage: python -m unittest discover [-h] [-v] [-q] [--locals] [-f] [-c] [-b]
[-s START] [-p PATTERN] [-t TOP]
[--list-tests]
python -m unittest discover: error: unrecognized arguments: --tabayo
0 0 0
$ ./python -m unittest discover ./Lib/unittest/test/ --help | wc
23 129 1110
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30523>
_______________________________________
More information about the Python-bugs-list
mailing list