kunit: tool: fix unit test cleanup handling
* Stop leaking file objects. * Use self.addCleanup() to ensure we call cleanup functions even if setUp() fails. * use mock.patch.stopall instead of more error-prone manual approach Signed-off-by: NDaniel Latypov <dlatypov@google.com> Reviewed-by: NDavid Gow <davidgow@google.com> Tested-by: NBrendan Higgins <brendanhiggins@google.com> Acked-by: NBrendan Higgins <brendanhiggins@google.com> Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
Showing
想要评论请 注册 或 登录