import os
import unittest
def main():
suite = unittest.TestLoader().discover(os.path.dirname(__file__),
pattern='*_tests.py')
results = unittest.TextTestRunner(verbosity=2).run(suite)
print repr(results)
if not results.wasSuccessful():
raise Exception('failed one or more unittests')
if __name__ == '__main__':
main()