This is a new pytest repo that covers the best practices
Checkout how if you run pip freeze | wc -l
there are many package you may not want
Try which python
virtualenv ~/.venv
vim ~/.bashrc
and put insource ~/.venv/bin/activate
- Verify the right python
which python
and trypip freeze | wc -l
- AWS Cloud Shell
- Use library style:
python -m pytest -vv --cov=mylib testing/
- Run tests by keyword expressions:
python -m pytest -vv -k "search"
- To run a specific test within a module:
python -m pytest -vv testing/test_fruity.py::test_random_fruit
- Run tests by marker expressions: https://docs.pytest.org/en/7.1.x/how-to/mark.html#mark
- Profile tests:
pytest --durations=10 --durations-min=1.0
- Skipping
@pytest.mark.skip(reason="no way of currently testing this")
- Checkout Fixtures here
- Easy because we leveraged
makefile
: buildspec.yml