From da0a011248ada980d116e76bc58ea4e608b27d1d Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Thu, 14 Apr 2022 16:03:32 +0900 Subject: [PATCH] Add destructor to wait for process termination This commit adds a destructor to wait for a process termination in `ReturnCodeToSubunit` class. This commit fixes #320 partially. --- stestr/output.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stestr/output.py b/stestr/output.py index d980897..5ecd9c6 100644 --- a/stestr/output.py +++ b/stestr/output.py @@ -171,6 +171,9 @@ def __init__(self, process): self.source = self.proc.stdout self.lastoutput = bytes((b'\n')[0]) + def __del__(self): + self.proc.wait() + def _append_return_code_as_test(self): if self.done is True: return