New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unittest -h shows a flag -s but it doesn't work #85425
Comments
I'm not 100% sure what's happening here but running:
shows a flag
When run as:
the command runs correctly but when run as
the command fails. $ python -m unittest -s test
usage: python -m unittest [-h] [-v] [-q] [--locals] [-f] [-c] [-b] [-k TESTNAMEPATTERNS] [tests [tests ...]
python -m unittest: error: unrecognized arguments: -s
Which I believe to be a bug as the help generated by the discover subcommand indicates that the flag -s should be recognized. |
Where do you see option -s? |
The -s option shown in $ python3 -m unittest -h
usage: python3 -m unittest [-h] [-v] [-q] [--locals] [-f] [-c] [-b]
[-k TESTNAMEPATTERNS]
[tests [tests ...]] positional arguments: optional arguments: Examples: usage: python3 -m unittest discover [-h] [-v] [-q] [--locals] [-f] [-c] [-b] optional arguments: For test discovery all test modules must be importable from the top level |
This appears to just be a misunderstanding: -s is a flag to "unittest discover", not to "unittest" itself. I think this is clear from the help text, so I'm closing this. If I'm incorrect, let me know. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: