◐ Shell
clean mode source ↗

Message 295087 - Python tracker

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