tests/run-tests.py
branchstable
changeset 880 0b9f0c42b566
parent 878 e1a93489159d
child 882 c3681742c0c7
--- a/tests/run-tests.py	Wed Feb 02 23:21:13 2011 +0100
+++ b/tests/run-tests.py	Fri Dec 24 15:23:01 2010 +0100
@@ -231,6 +231,8 @@
                 if line and not line.startswith('#'):
                     blacklist[line] = filename
 
+            f.close()
+
         options.blacklist = blacklist
 
     return (options, args)
@@ -491,6 +493,8 @@
             # non-command/result - queue up for merged output
             after.setdefault(pos, []).append(l)
 
+    t.close()
+
     script.append('echo %s %s $?\n' % (salt, n + 1))
 
     fd, name = tempfile.mkstemp(suffix='hg-tst')
@@ -927,7 +931,9 @@
                 continue
 
             if options.keywords:
-                t = open(test).read().lower() + test.lower()
+                fp = open(test)
+                t = fp.read().lower() + test.lower()
+                fp.close()
                 for k in options.keywords.lower().split():
                     if k in t:
                         break