view tests/silenttestrunner.py @ 23965:6156edaa82aa stable

revert: move prefetch to after the actions logic The prefetch logic came before the actual population of the actions collection, so it was always being passed an empty action list. This fixes it by moving it to after that logic. The only consumer of this function at the moment is remotefilelog, and I verified it works with this change.
author Durham Goode <durham@fb.com>
date Tue, 27 Jan 2015 19:52:26 -0800
parents dadcd40b62d8
children fc2268b9a07c
line wrap: on
line source

import unittest, sys, os

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)

if os.environ.get('SILENT_BE_NOISY'):
    main = unittest.main