Mercurial > hg-stable
changeset 15416:3b7c4f96885c
run-tests: minor cleanups
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 03 Nov 2011 15:18:10 -0500 |
parents | 8c90b3df5bed |
children | 5261140d9322 |
files | tests/run-tests.py |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Thu Nov 03 15:08:45 2011 -0500 +++ b/tests/run-tests.py Thu Nov 03 15:18:10 2011 -0500 @@ -559,10 +559,6 @@ return False def tsttest(test, wd, options, replacements): - t = open(test) - out = [] - script = [] - # We generate a shell script which outputs unique markers to line # up script results with our source. These markers include input # line number and the last return code @@ -584,6 +580,11 @@ # can generate the surrounding doctest magic inpython = False + f = open(test) + t = f.readlines() + f.close() + + script = [] for n, l in enumerate(t): if not l.endswith('\n'): l += '\n' @@ -623,12 +624,11 @@ # non-command/result - queue up for merged output after.setdefault(pos, []).append(l) - t.close() - if inpython: script.append("EOF\n") addsalt(n + 1) + # Write out the script and execute it fd, name = tempfile.mkstemp(suffix='hg-tst') try: for l in script: