heredoctest.py
9 lines
| 264 B
| text/x-python
|
PythonLexer
/ tests / heredoctest.py
|
r15235 | import doctest, tempfile, os, sys | ||
if __name__ == "__main__": | ||||
fd, name = tempfile.mkstemp(suffix='hg-tst') | ||||
os.write(fd, sys.stdin.read()) | ||||
os.close(fd) | ||||
failures, _ = doctest.testfile(name, module_relative=False) | ||||
if failures: | ||||
sys.exit(1) | ||||