From 91b3a28c6d5165e5e303ec0de1a10cd2926cf006 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Tue, 27 Jun 2023 15:12:29 +0200 Subject: [PATCH] docs: fix gen_test_case_reference collect only when warnings are present --- docs/gen_test_case_reference.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/gen_test_case_reference.py b/docs/gen_test_case_reference.py index 8816b52830..6563ad4378 100644 --- a/docs/gen_test_case_reference.py +++ b/docs/gen_test_case_reference.py @@ -190,7 +190,9 @@ def run_collect_only(test_path: Path = source_directory) -> Tuple[str, str]: collect_only_command = f"fill --collect-only -q --until {DEV_FORKS[-1]} {test_path}" # strip out the test module output_lines = [ - line.split("::")[1] for line in output.split("\n") if line.startswith("tests/") + line.split("::")[1] + for line in output.split("\n") + if line.startswith("tests/") and "::" in line ] # prefix with required indent for admonition in MARKDOWN_TEST_CASES_TEMPLATE collect_only_output = "\n".join(" " + line for line in output_lines)