Commit 33b83d53 authored by Tom Niget's avatar Tom Niget

Use with instead of direct call to exit

parent 6297a1f5
......@@ -42,7 +42,8 @@ class TestRegistryClientInteract(unittest.TestCase):
def tearDown(self):
self.server.proc.terminate()
self.server.proc.__exit__()
with self.server.proc:
pass
def test_1_main(self):
""" a client interact a server, no re6stnet node test basic function"""
......
......@@ -136,7 +136,8 @@ class Re6stRegistry:
try:
logging.debug("teminate process %s", self.proc.pid)
self.proc.destroy()
self.proc.__exit__()
with self.proc:
pass
except:
pass
......@@ -263,7 +264,8 @@ class Re6stNode:
"""stop running re6stnet process"""
logging.debug("%s teminate process %s", self.name, self.proc.pid)
self.proc.destroy()
self.proc.__exit__()
with self.proc:
pass
def __del__(self):
"""teminate process and rm temp dir"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment