summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/soledad/__init__.py1
-rw-r--r--src/leap/soledad/tests/test_couch.py8
-rw-r--r--src/leap/soledad/tests/test_sqlcipher.py2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index c9c981c2..688ee160 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -66,7 +66,6 @@ class Soledad(object):
try:
with open(self.SECRET_PATH) as f:
self._secret = str(self._gpg.decrypt(f.read()))
- f.close()
except IOError:
raise IOError('Failed to open secret file %s.' % self.SECRET_PATH)
diff --git a/src/leap/soledad/tests/test_couch.py b/src/leap/soledad/tests/test_couch.py
index a9b2f39e..55bcf442 100644
--- a/src/leap/soledad/tests/test_couch.py
+++ b/src/leap/soledad/tests/test_couch.py
@@ -44,6 +44,7 @@ class CouchDBWrapper(object):
conf = handle.read() % {
'tempdir': self.tempdir,
}
+ handle.close()
confPath = os.path.join(self.tempdir, 'test.ini')
handle = open(confPath, 'w')
@@ -53,10 +54,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):
@@ -77,6 +78,7 @@ stderr:
handle = open(logPath)
line = handle.read()
+ handle.close()
m = PORT_RE.search(line)
if not m:
self.stop()
diff --git a/src/leap/soledad/tests/test_sqlcipher.py b/src/leap/soledad/tests/test_sqlcipher.py
index 042ee4ff..38ad09ed 100644
--- a/src/leap/soledad/tests/test_sqlcipher.py
+++ b/src/leap/soledad/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