From: Simon Glass Date: Tue, 14 May 2019 15:53:38 -0600 Subject: [U-Boot] [PATCH 04/21] binman: Don't show errors for failed tests In-Reply-To: <20190514215355.246399-1-sjg@chromium.org> References: <20190514215355.246399-1-sjg@chromium.org> Message-ID: <20190514215355.246399-5-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de An unfortunate new feature in Python 3.5 causes binman to print errors for non-existent tests, when the test filter is used. Work around this by detecting the unwanted tests and removing them from the result. Signed-off-by: Simon Glass --- tools/binman/binman.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/binman/binman.py b/tools/binman/binman.py index 4206d2b0e3..aad2e9c8bc 100755 --- a/tools/binman/binman.py +++ b/tools/binman/binman.py @@ -87,6 +87,18 @@ def RunTests(debug, processes, args): else: suite.run(result) + # Remove errors which just indicate a missing test. Since Python v3.5 If an + # ImportError or AttributeError occurs while traversing name then a + # synthetic test that raises that error when run will be returned. These + # errors are included in the errors accumulated by result.errors. + if test_name: + errors = [] + for test, err in result.errors: + if ("has no attribute '%s'" % test_name) not in err: + errors.append((test, err)) + result.testsRun -= 1 + result.errors = errors + print(result) for test, err in result.errors: print(test.id(), err) -- 2.21.0.1020.gf2820cf01a-goog