TextTestRunner has stream=sys.stderr in its constructor:
def __init__(self, stream=sys.stderr, descriptions=1, verbosity=1)
Change it to an empty thread.
result = unittest.TextTestRunner(stream = open(os.devnull, 'w')).run(alltests) if len(result.failures) or len(result.errors): print "Sorry."
Tal weiss
source share