view tests/silenttestrunner.py @ 23091:8d43c6bb38c0 stable

doc: change 'revision or range' to 'revision or revset' The phrase "revision or range" comes from a pre-revset era. Since the documentation for ranges now is under the revset docs, and as a helpful hint nudging users towards revsets, I think it's better to say "revision or revset"
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 24 Oct 2014 13:50:00 -0400
parents 2cbfb8c497ee
children dadcd40b62d8
line wrap: on
line source

import unittest, sys

def main(modulename):
    '''run the tests found in module, printing nothing when all tests pass'''
    module = sys.modules[modulename]
    suite = unittest.defaultTestLoader.loadTestsFromModule(module)
    results = unittest.TestResult()
    suite.run(results)
    if results.errors or results.failures:
        for tc, exc in results.errors:
            print 'ERROR:', tc
            print
            sys.stdout.write(exc)
        for tc, exc in results.failures:
            print 'FAIL:', tc
            print
            sys.stdout.write(exc)
        sys.exit(1)