kunit: tool: fix unit test cleanup handling
stable inclusion from stable-5.10.20 commit ecb23b97a70b89054926dbf87e1bd22864236a1a bugzilla: 50608 -------------------------------- [ Upstream commit cfd607e4 ] * 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> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录