A pytest plugin that works with pytest-cov to generate coverage data for CircleCI's Smarter Testing.
Install the plugin via git.
python -m pip install git+https://github.com/circleci/pytest-circleci-coverage.gitInstall pytest-cov.
Run pytest with coverage and the --circleci-coverage flag to generate coverage JSON.
pytest --cov --cov-context=test --circleci-coverage=coverage.jsonInstall the plugin locally in editable mode.
pip install --editable .Run tests.
pytest