Fix unit tests for mainUtils
Commit replaced too many usages
of "with self.lock as l" with "with self.lock"
This commit corrects the missing "with self.lock as l" problems to
ensure the unit tests pass
Authored-by: Tyler Ramer
@@ -24,7 +24,7 @@ class MainUtilsTestCase(GpTestCase):
self.assertEquals(False, os.path.exists(self.lockfile))
def test_lock_owned_by_parent(self):
- with self.lock:
+ with self.lock as l:
self.assertEquals(l.read_pid(), self.ppid)
@@ -34,7 +34,7 @@ class MainUtilsTestCase(GpTestCase):
self.lock.acquire()
def test_child_can_read_lock_owner(self):
- with self.lock:
+ with self.lock as l:
pid = os.fork()
if pid == 0:
self.assertEquals(l.read_pid(), self.ppid)
