fix(tools): recognize indented skip reasons in check_skips list

This commit is contained in:
emirplus committed 2026-10-17 14:21:14 +03:00
1 parent 673f7406c5
commit 9c6efd3771
2 files changed
+18 -1

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ if __name__ == "__main__":
parser.error(str(error))
if args.list:
for name, output in found:
reason = next((line.strip() for line in output.splitlines() if line.startswith("skipped")), "")
reason = next((line.strip() for line in output.splitlines() if line.strip().lower().startswith("skipped")), "")
print(f"{name}: {reason}")
raise SystemExit
if args.job == "windows":
+17
View File
@@ -152,6 +152,23 @@ class CheckSkipsTests(unittest.TestCase):
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
self.assertIn("all expected", result.stdout)
def test_list_reports_skipped_reasons_including_indented_lines(self):
xml = (
'<testsuite>'
'<testcase name="normal"><skipped message="device limitation"/></testcase>'
'<testcase name="indented"><skipped/><system-out>\n skipped, host imports are unavailable\n</system-out></testcase>'
'<testcase name="capitalized"><skipped/><system-err>\n Skipped, no display\n</system-err></testcase>'
'</testsuite>'
)
with tempfile.TemporaryDirectory() as directory:
junit = Path(directory) / "junit.xml"
junit.write_text(xml, encoding="utf-8")
result = subprocess.run([sys.executable, "-I", str(TOOL), str(junit), "--list"], capture_output=True, text=True)
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
self.assertIn("normal: skipped, device limitation", result.stdout)
self.assertIn("indented: skipped, host imports are unavailable", result.stdout)
self.assertIn("capitalized: Skipped, no display", result.stdout)