From 51653610efc364a46fa73a4caeee44b4186a340f Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Thu, 5 Sep 2013 15:44:31 -0700 Subject: [PATCH] Fix cleanup of test controller --- IPython/testing/iptestcontroller.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 68b545f65..b8d1a8900 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -95,7 +95,7 @@ class IPTestController(object): subprocess.call(["coverage", "xml", "-o", self.coverage_xml]) return retcode - def cleanup(self): + def cleanup_process(self): """Cleanup on exit by killing any leftover processes.""" subp = self.process if subp is None or (subp.poll() is not None): @@ -118,7 +118,10 @@ class IPTestController(object): if subp.poll() is None: # The process did not die... print('... failed. Manual cleanup may be required.') - + + def cleanup(self): + "Kill process if it's still alive, and clean up temporary directories" + self.cleanup_process() for td in self.dirs: td.cleanup()