提交 c81d9256 编写于 作者: T Tyler Ramer

Fix unit tests for mainUtils

Commit 4ab87e24f61b9aff26738cdb154673e03cd772a8 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: NTyler Ramer <tramer@vmware.com>
上级 b22544fb
...@@ -24,7 +24,7 @@ class MainUtilsTestCase(GpTestCase): ...@@ -24,7 +24,7 @@ class MainUtilsTestCase(GpTestCase):
self.assertEquals(False, os.path.exists(self.lockfile)) self.assertEquals(False, os.path.exists(self.lockfile))
def test_lock_owned_by_parent(self): def test_lock_owned_by_parent(self):
with self.lock: with self.lock as l:
self.assertEquals(l.read_pid(), self.ppid) self.assertEquals(l.read_pid(), self.ppid)
...@@ -34,7 +34,7 @@ class MainUtilsTestCase(GpTestCase): ...@@ -34,7 +34,7 @@ class MainUtilsTestCase(GpTestCase):
self.lock.acquire() self.lock.acquire()
def test_child_can_read_lock_owner(self): def test_child_can_read_lock_owner(self):
with self.lock: with self.lock as l:
pid = os.fork() pid = os.fork()
if pid == 0: if pid == 0:
self.assertEquals(l.read_pid(), self.ppid) self.assertEquals(l.read_pid(), self.ppid)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册