pytest注释 作为插件。 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 .