- Install pytest,
pip3 install pytest pytest-cov pytest-codecov gitpython
- Run pytest,
pytest tests --cov --cov-report term --cov-report html
Or run failed tests only,
pytest tests --cov --cov-report term --cov-report html --last-failed
Or run for specific py file,
pytest tests/test_emotion.py --cov --cov-report term --cov-report html
Or run for specific function,
pytest tests/test_emotion.py::test_multinomial --cov --cov-report term --cov-report html
- Upload to CodeCov, https://app.codecov.io/gh/huseinzol05/malaya
CODECOV_TOKEN=
pytest tests --cov --codecov --codecov-token=$CODECOV_TOKEN