February 2022
Intermediate to advanced
274 pages
6h 28m
English
The headquarters for pytest is https://pytest.org. That’s the official documentation. But it’s distributed through PyPI (the Python Package Index) at https://pypi.org/project/pytest.
Like other Python packages distributed through PyPI, use pip to install pytest into the virtual environment you’re using for testing:
| | $ python3 -m venv venv |
| | $ source venv/bin/activate |
| | (venv) $ pip install pytest |
The (venv) added before the command prompt lets you know that you are using a virtual environment. For the examples in the rest of the book, we’ll always use a virtual environment. However, in order to save a little clutter on the page, (venv) has been removed. We’ll also always be using python3, but will shorten it to python.
If you ...
Read now
Unlock full access