September 2017
Intermediate to advanced
222 pages
5h 1m
English
pytest finds tests to run based on certain test discovery rules. The standard test discovery rules are:
Start at one or more directory. You can specify filenames or directory names on the command line. If you don’t specify anything, the current directory is used.
Look in the directory and all subdirectories recursively for test modules.
A test module is a file with a name that looks like test_*.py or *_test.py.
Look in test modules for functions that start with test_.
Look for classes that start with Test. Look for methods in those classes that start with test_ but don’t have an __init__ method.
These are the standard discovery rules; however, you can change them.
The usual test discovery rule for ...
Read now
Unlock full access