#!/usr/bin/env python

from unittest import TextTestRunner
import test

TextTestRunner().run(test.tests())

#!/usr/bin/env python

from unittest import TextTestRunner
import test
import sys

result = TextTestRunner().run(test.tests())
if not result.wasSuccessful():
  sys.exit(1)

Exit with non-zero status on test failure