Skip to content

Instantly share code, notes, and snippets.

@alexanderjulo
Created July 14, 2012 16:01
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 alexanderjulo/3111902 to your computer and use it in GitHub Desktop.
Save alexanderjulo/3111902 to your computer and use it in GitHub Desktop.
#!/bin/bash
# enable virtual environment for python
source venv/bin/activate
# hide changes that are not in this commit
git stash -q --keep-index
./manage.py test
RESULT=$?
# get non relevant changes back
git stash pop -q
# stop commit if tests fail
[ $RESULT -ne 0 ] && exit 1
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment