Small demo project for learning pytest basics. It includes two simple functions in hello.py and matching tests in test_hello.py.
- Python 3.11+ recommended.
- Install dependencies:
make install- or
pip install -r requirements.txt
- Run tests:
make test(runspytest -vv) - Lint:
make lint(runs pylint on hello.py) - Format:
make format(runs black) - Do everything:
make all
python -m pytest -vvto run the suite.- Add
--cov=. --cov-report=term-missingif you want quick coverage info.
- hello.py: functions
sayHi()andsayHello(). - test_hello.py: pytest tests for both functions.
- Makefile: handy shortcuts for install/test/format/lint.
- requirements.txt: dev and test dependencies.