#What is this Do you want automatic code coverage generated for your project as soon as you save a file?
Install these extensions and configure them:
- Python https://marketplace.visualstudio.com/items?itemName=ms-python.python
- Configure your tests by running
Python: Configure Tests
in the command palette.
- Configure your tests by running
- Python Test Explorer for Visual Studio Code https://marketplace.visualstudio.com/items?itemName=LittleFoxTeam.vscode-python-test-adapter
- Set tests to auto-run
- Coverage Gutters https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
Add the options from the config files to the root of your project
To run this, do:
- Save any file
- Test explorer triggers pytest
- pytest generates coverage
- coverage generates xml
- Click "watch" on status bar
- Gutters will start appearing