Patrick Bailey
Patrick Bailey

Reputation: 1

Django how do I get a command to execute when all tests pass?

I'm trying to find out if there is a way to have a function fire when all the tests pass.

trying to do something along the lines of:

call(["say", "all tests have passed Dave"])

Upvotes: 0

Views: 52

Answers (1)

Antonis Christofides
Antonis Christofides

Reputation: 6939

When you run ./manage.py test, the exit status of the command is zero (success) if all tests have passed and non-zero (failure) otherwise. In Unix/Linux, you can do this:

./manage.py test  &&  echo "All tests have passed"

For Windows, see another stackoverflow question.

Upvotes: 1

Related Questions