view tests/heredoctest.py @ 15346:53f37b24f26a stable

tests: check for svn >= 1.3 and >= 1.5 in tests that require those versions
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 23 Oct 2011 21:22:55 +0200
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)