PyAnnotate as a pytest plugin.
pip install pytest-annotate
# Generate annotations by running your pytest tests as usual:
pytest --annotate-output=./annotations.json
# Apply those annotations using pyannotate:
pyannotate --type-info ./annotations.json .