From f68c94dfbbdd64c727a0207f249f37f2d0a05f89 Mon Sep 17 00:00:00 2001 From: Euripedes Rocha Date: Tue, 5 Sep 2023 15:12:35 +0200 Subject: [PATCH] fix(ci): Move error handling to correct scope --- tools/ci/idf_pytest/script.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/ci/idf_pytest/script.py b/tools/ci/idf_pytest/script.py index a2d7913e49..a970864478 100644 --- a/tools/ci/idf_pytest/script.py +++ b/tools/ci/idf_pytest/script.py @@ -64,12 +64,12 @@ def get_pytest_cases( cmd.extend(['-k', filter_expr]) res = pytest.main(cmd, plugins=[collector]) - if res.value != ExitCode.OK: - if res.value == ExitCode.NO_TESTS_COLLECTED: - print(f'WARNING: no pytest app found for target {target} under paths {", ".join(paths)}') - else: - print(buf.getvalue()) - raise RuntimeError(f'pytest collection failed at {", ".join(paths)} with command \"{" ".join(cmd)}\"') + if res.value != ExitCode.OK: + if res.value == ExitCode.NO_TESTS_COLLECTED: + print(f'WARNING: no pytest app found for target {target} under paths {", ".join(paths)}') + else: + print(buf.getvalue()) + raise RuntimeError(f'pytest collection failed at {", ".join(paths)} with command \"{" ".join(cmd)}\"') cases.extend(collector.cases)