September 2017
Intermediate to advanced
222 pages
5h 1m
English
We’ve used the verbose option, -v or --verbose, a couple of times already, but there are many more options worth knowing about. We’re not going to use all of the options in this book, but quite a few. You can see all of them with pytest --help.
The following are a handful of options that are quite useful when starting out with pytest. This is by no means a complete list, but these options in particular address some common early desires for controlling how pytest runs when you’re first getting started.
| | $ pytest --help |
| | ... subset of the list ... |
| | -k EXPRESSION only run tests/classes which match the given |
| | substring expression. |
| | Example: -k 'test_method or test_other' matches |
| | all test functions ... |
Read now
Unlock full access