Mercurial > hg
view tests/heredoctest.py @ 15403:e27561eb4a76
localrepo: add revs helper method
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 02 Nov 2011 13:37:34 -0500 |
parents | 474279be5add |
children | 5635a4017061 |
line wrap: on
line source
import doctest, tempfile, os, sys if __name__ == "__main__": if 'TERM' in os.environ: del os.environ['TERM'] 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)