diff options
author | drebs <drebs@leap.se> | 2013-02-04 19:34:23 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-02-04 19:34:23 -0200 |
commit | fb13d4d6ea63c92cc97e81d61a556de8001b4ba1 (patch) | |
tree | ed0e32d91c07a08524f6713e65846fc61b4e227d /src/leap/soledad/tests/test_couch.py | |
parent | 5505f1397f7130b9731e51cb52abd820a8564cb8 (diff) |
Close file handles.
Diffstat (limited to 'src/leap/soledad/tests/test_couch.py')
-rw-r--r-- | src/leap/soledad/tests/test_couch.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/leap/soledad/tests/test_couch.py b/src/leap/soledad/tests/test_couch.py index b5d6378c..6eb5501c 100644 --- a/src/leap/soledad/tests/test_couch.py +++ b/src/leap/soledad/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() |