Skip to content

Instantly share code, notes, and snippets.

@batisteo
Created June 12, 2018 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batisteo/287129f2a3d115c35eb0ee1574c24b27 to your computer and use it in GitHub Desktop.
Save batisteo/287129f2a3d115c35eb0ee1574c24b27 to your computer and use it in GitHub Desktop.
Run coverage for a django project with watchexec
cover() {
watchexec -r -s SIGTERM -w src -e py -- 'coverage run ./src/manage.py test --keepdb '$1' && coverage xml -o cov.xml ; coverage report --skip-covered'
}
cov() {
watchexec -r -s SIGTERM -w src -e py -- 'coverage run --parallel-mode ./src/manage.py test --keepdb --parallel 2 --exclude-tag slow '$1' && coverage xml -o cov.xml && coverage report --skip-covered'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment