##// END OF EJS Templates
tests: remove temp doctest file when finished running it
tests: remove temp doctest file when finished running it

File last commit:

r15247:3cd1605e default
r15247:3cd1605e default
Show More
heredoctest.py
13 lines | 331 B | text/x-python | PythonLexer
Idan Kamara
tests: add helper script for processing doctests read from stdin...
r15235 import doctest, tempfile, os, sys
if __name__ == "__main__":
fd, name = tempfile.mkstemp(suffix='hg-tst')
Idan Kamara
tests: remove temp doctest file when finished running it
r15247
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)