[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFd5g45OdZ-u7Z4iy8DoEbEMVp5c6YkVf0L8yqUewZ=z+NcuNg@mail.gmail.com>
Date: Mon, 4 Oct 2021 15:35:46 -0700
From: Brendan Higgins <brendanhiggins@...gle.com>
To: Daniel Latypov <dlatypov@...gle.com>
Cc: davidgow@...gle.com, linux-kernel@...r.kernel.org,
kunit-dev@...glegroups.com, linux-kselftest@...r.kernel.org,
skhan@...uxfoundation.org
Subject: Re: [PATCH] kunit: tool: misc fixes (unused vars, imports, leaked files)
On Tue, Sep 28, 2021 at 3:11 PM Daniel Latypov <dlatypov@...gle.com> wrote:
>
> Drop some variables in unit tests that were unused and/or add assertions
> based on them.
>
> For ExitStack, it was imported, but the `es` variable wasn't used so it
> didn't do anything, and we were leaking the file objects.
> Refactor it to just use nested `with` statements to properly close them.
>
> And drop the direct use of .close() on file objects in the kunit tool
> unit test, as these can be leaked if test assertions fail.
>
> Signed-off-by: Daniel Latypov <dlatypov@...gle.com>
Reviewed-by: Brendan Higgins <brendanhiggins@...gle.com>
Powered by blists - more mailing lists