June 2017
Beginner to intermediate
274 pages
6h 49m
English
There are a few command-line options we can use to adjust the behavior of unit test discovery. The first, which we saw in the previous code example, is the -v switch. This switch makes test reports somewhat more verbose. We used it in the previous code so we could see that the discovery had worked properly.
We can also use the -p command-line option (as shown in the following code example) to change the pattern that is used to recognize test files:

Here, we've changed it so that the filenames ending in the word one.py are recognized as test files.
The unittest discover code also recognizes -s to ...
Read now
Unlock full access