Prechádzať zdrojové kódy

fix(ci): Move error handling to correct scope

Euripedes Rocha 2 rokov pred
rodič
commit
f68c94dfbb
1 zmenil súbory, kde vykonal 6 pridanie a 6 odobranie
  1. 6 6
      tools/ci/idf_pytest/script.py

+ 6 - 6
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)