2010-07-01 4 views

답변

7

TextTestRunner는 생성자에서 stream=sys.stderr 있습니다 널 스트림에

def __init__(self, stream=sys.stderr, descriptions=1, verbosity=1) 

변경을.

result = unittest.TextTestRunner(stream = open(os.devnull, 'w')).run(alltests) 
if len(result.failures) or len(result.errors): 
    print "Sorry." 
관련 문제