Review
Congratulations! You’ve done quite a bit so far in this chapter and are on a good pace to master pytest quickly. Here’s a quick review of what was covered in the chapter:
-
pytest is installed into a virtual environment with the following steps:
-
python -m venv venv
-
source venv/bin/activate (or venv\Scripts\activate.bat/venv\Scripts\Activate.ps1 on Windows)
-
pip install pytest
-
-
pytest can be run in several different ways:
-
pytest: With no arguments, pytest searches the local directory and subdirectories for tests.
-
pytest <filename>: Runs the tests in one file
-
pytest <filename> <filename> ...: Runs the tests in multiple named files
-
pytest <dirname>: Starts in a particular directory (or more than one) and recursively searches for tests
-
-
Test ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access