view tests/silenttestrunner.py @ 27698:dad6404ccddb

bmstore: add handling of the active bookmark This further centralizes the handling of bookmark storage, and will help get some lingering bookmarks business out of localrepo. Right now, this change implies reading of the active bookmark to also imply reading all bookmarks from disk - for users with many many bookmarks this may be a measurable performance hit. In that case, we should migrate bmstore to be able to lazy-read its properties from disk rather than having to eagerly read them, but I decided to avoid doing that to try and avoid some potentially complicated filecache decorator issues. This doesn't move the logic for writing the active bookmark into a transaction, though that is probably the correct next step. Since the API probably needs to morph a little more, I didn't bother marking bookmarks.{activate,deactivate} as deprecated yet.
author Augie Fackler <augie@google.com>
date Wed, 11 Nov 2015 21:18:02 -0500
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