summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMukund Sivaraman <muks@isc.org>2012-04-05 13:08:14 +0200
committerMukund Sivaraman <muks@isc.org>2012-04-05 13:08:14 +0200
commiteae421b4814a766ff14199a72e489768287654db (patch)
tree259a2b1f696fd68a3c58abe9c6f540ab52597de4
parent[1828] Close open handles when done (diff)
downloadkea-eae421b4814a766ff14199a72e489768287654db.tar.xz
kea-eae421b4814a766ff14199a72e489768287654db.zip
[1828] Close open handles when done using them (contd.)
-rw-r--r--src/bin/msgq/tests/msgq_test.py4
-rw-r--r--src/bin/tests/process_rename_test.py.in9
2 files changed, 10 insertions, 3 deletions
diff --git a/src/bin/msgq/tests/msgq_test.py b/src/bin/msgq/tests/msgq_test.py
index fe4f7d4666..cc078f41e8 100644
--- a/src/bin/msgq/tests/msgq_test.py
+++ b/src/bin/msgq/tests/msgq_test.py
@@ -155,6 +155,8 @@ class SendNonblock(unittest.TestCase):
sender(msgq, write)
except socket.error:
pass
+ read.close()
+ write.close()
def test_infinite_sendmsg(self):
"""
@@ -217,6 +219,8 @@ class SendNonblock(unittest.TestCase):
finally:
os.kill(queue_pid, signal.SIGTERM)
self.terminate_check(run)
+ queue.close()
+ out.close()
def test_small_sends(self):
"""
diff --git a/src/bin/tests/process_rename_test.py.in b/src/bin/tests/process_rename_test.py.in
index f96c023841..ced698e1c8 100644
--- a/src/bin/tests/process_rename_test.py.in
+++ b/src/bin/tests/process_rename_test.py.in
@@ -25,7 +25,9 @@ class TestRename(unittest.TestCase):
def __scan(self, directory, script, fun):
# Scan one script if it contains call to the renaming function
filename = os.path.join(directory, script)
- data = ''.join(open(filename).readlines())
+ fd = open(filename)
+ data = ''.join(fd.readlines())
+ fd.close()
prettyname = 'src' + filename[filename.rfind('../') + 2:]
self.assertTrue(fun.search(data),
"Didn't find a call to isc.util.process.rename in " + prettyname)
@@ -53,8 +55,9 @@ class TestRename(unittest.TestCase):
# Find all Makefile and extract names of scripts
for (d, _, fs) in os.walk('@top_builddir@'):
if 'Makefile' in fs:
- makefile = ''.join(open(os.path.join(d,
- "Makefile")).readlines())
+ fd = open(os.path.join(d, "Makefile"))
+ makefile = ''.join(fd.readlines())
+ fd.close()
for (var, _) in lines.findall(re.sub(excluded_lines, '',
makefile)):
for (script, _) in scripts.findall(var):