summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-02-04 19:34:23 -0200
committerdrebs <drebs@leap.se>2013-02-04 19:34:23 -0200
commit4e058b62589defe7a15d633a20b17bed75484d56 (patch)
treec1f25dd9acc7ff8d8e4ec0184a2a15d35effef91 /tests
parent74372f4c613d22a094a91ba4a5e41b776c5a2867 (diff)
Close file handles.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_couch.py8
-rw-r--r--tests/test_sqlcipher.py2
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_couch.py b/tests/test_couch.py
index b5d6378c..6eb5501c 100644
--- a/tests/test_couch.py
+++ b/tests/test_couch.py
@@ -42,6 +42,7 @@ class CouchDBWrapper(object):
conf = handle.read() % {
'tempdir': self.tempdir,
}
+ handle.close()
confPath = os.path.join(self.tempdir, 'test.ini')
handle = open(confPath, 'w')
@@ -51,10 +52,10 @@ class CouchDBWrapper(object):
# create the dirs from the template
os.mkdir(os.path.join(self.tempdir, 'lib'))
os.mkdir(os.path.join(self.tempdir, 'log'))
- argus = ['couchdb', '-n' '-a', confPath]
- null = open('/dev/null', 'w')
+ args = ['couchdb', '-n' '-a', confPath]
+ #null = open('/dev/null', 'w')
self.process = subprocess.Popen(
- argus, env=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ args, env=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# find port
logPath = os.path.join(self.tempdir, 'log', 'couch.log')
while not os.path.exists(logPath):
@@ -75,6 +76,7 @@ stderr:
handle = open(logPath)
line = handle.read()
+ handle.close()
m = PORT_RE.search(line)
if not m:
self.stop()
diff --git a/tests/test_sqlcipher.py b/tests/test_sqlcipher.py
index 0d5d00ee..18b9173e 100644
--- a/tests/test_sqlcipher.py
+++ b/tests/test_sqlcipher.py
@@ -3,7 +3,7 @@
import os
import time
from sqlite3 import dbapi2, DatabaseError
-import unittest2 as unittest
+import unittest
from StringIO import StringIO
import threading