view tests/heredoctest.py @ 15317:41f371150ccb stable

largefiles: make the store primary, and the user cache secondary This uses the now-properly-named functions and methods from the previous patch to actually deliver the desired behavior
author Benjamin Pollack <benjamin@bitquabit.com>
date Thu, 20 Oct 2011 13:24:11 -0400
parents 3cd1605e9d8e
children 474279be5add
line wrap: on
line source

import doctest, tempfile, os, sys

if __name__ == "__main__":
    fd, name = tempfile.mkstemp(suffix='hg-tst')

    try:
        os.write(fd, sys.stdin.read())
        os.close(fd)
        failures, _ = doctest.testfile(name, module_relative=False)
        if failures:
            sys.exit(1)
    finally:
        os.remove(name)