pytest-mock-examples
pytest-mock-examples copied to clipboard
Examples for the blog post on pytest-mock
Samples for using pytest-mock
This repository hosts the code in
Running the code
Requirements
- Python version
>=3.5
is required.
Create environment
After cloning the repository, create a virtual environment in the repository with
python3 -m venv .venv
Then activate the virtual environment and install the repository as a package
# For Macs or Linux
source .venv/bin/activate
# For Windows
.venv\Scripts\activate
# Navigate to where setup.py is
pip install -e .
Running tests
To run the tests, run
# print out the durations for each test
pytest --durations=0