From 908574caa96a80483fa642e08b3b1e9ad1cd1c60 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 13 Jul 2015 11:07:05 +0200 Subject: kill() and waitpid() custodia process The test suite leaves child processes behind. The teardown class method now call Popen.kill() and Popen.wait() to kill and wait for its child process. Signed-off-by: Christian Heimes Reviewed-by: Simo Sorce Closes #5 --- tests/custodia.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/custodia.py b/tests/custodia.py index 754c1b3..84dc554 100644 --- a/tests/custodia.py +++ b/tests/custodia.py @@ -27,10 +27,8 @@ class CustodiaTests(unittest.TestCase): @classmethod def tearDownClass(self): - try: - os.killpg(self.custodia_process.pid, signal.SIGTERM) - except OSError: - pass + self.custodia_process.kill() + self.custodia_process.wait() for fname in ['server_socket', 'secrets.db']: try: os.unlink(fname) -- cgit