diff --git a/scripts/update_lib/auto_mark.py b/scripts/update_lib/auto_mark.py index 4e1c9119552..c99a963799f 100644 --- a/scripts/update_lib/auto_mark.py +++ b/scripts/update_lib/auto_mark.py @@ -173,7 +173,7 @@ def _parse_error_details(test_results: TestResult, lines: list[str]) -> None: # Collect lines until the next separator or end while i < len(lines): current = lines[i] - if current.startswith("====="): + if current.startswith("=====") or current.startswith("-----"): break error_lines.append(current) i += 1 diff --git a/scripts/update_lib/tests/test_auto_mark.py b/scripts/update_lib/tests/test_auto_mark.py index ac357f5ea27..e155b40addd 100644 --- a/scripts/update_lib/tests/test_auto_mark.py +++ b/scripts/update_lib/tests/test_auto_mark.py @@ -32,20 +32,20 @@ def test_parse_failing_test(self): """Test parsing a failing test.""" stdout = """ Run 1 tests sequentially -test_foo (test.test_example.TestClass) ... FAIL +test_foo (test.test_example.TestClass.test_foo) ... FAIL ----------- """ result = parse_results(self._make_result(stdout)) self.assertEqual(len(result.tests), 1) self.assertEqual(result.tests[0].name, "test_foo") - self.assertEqual(result.tests[0].path, "test.test_example.TestClass") + self.assertEqual(result.tests[0].path, "test.test_example.TestClass.test_foo") self.assertEqual(result.tests[0].result, "fail") def test_parse_error_test(self): """Test parsing an error test.""" stdout = """ Run 1 tests sequentially -test_bar (test.test_example.TestClass) ... ERROR +test_bar (test.test_example.TestClass.test_bar) ... ERROR ----------- """ result = parse_results(self._make_result(stdout)) @@ -56,7 +56,7 @@ def test_parse_ok_test_ignored(self): """Test that passing tests are ignored.""" stdout = """ Run 1 tests sequentially -test_foo (test.test_example.TestClass) ... ok +test_foo (test.test_example.TestClass.test_foo) ... ok ----------- """ result = parse_results(self._make_result(stdout)) @@ -66,15 +66,15 @@ def test_parse_unexpected_success(self): """Test parsing unexpected success.""" stdout = """ Run 1 tests sequentially -test_foo (test.test_example.TestClass) ... unexpected success +test_foo (test.test_example.TestClass.test_foo) ... unexpected success ----------- -UNEXPECTED SUCCESS: test_foo (test.test_example.TestClass) +UNEXPECTED SUCCESS: test_foo (test.test_example.TestClass.test_foo) """ result = parse_results(self._make_result(stdout)) self.assertEqual(len(result.unexpected_successes), 1) self.assertEqual(result.unexpected_successes[0].name, "test_foo") self.assertEqual( - result.unexpected_successes[0].path, "test.test_example.TestClass" + result.unexpected_successes[0].path, "test.test_example.TestClass.test_foo" ) def test_parse_tests_result(self): @@ -89,9 +89,9 @@ def test_parse_multiple_tests(self): """Test parsing multiple test results.""" stdout = """ Run 3 tests sequentially -test_one (test.test_example.TestA) ... FAIL -test_two (test.test_example.TestA) ... ok -test_three (test.test_example.TestB) ... ERROR +test_one (test.test_example.TestA.test_one) ... FAIL +test_two (test.test_example.TestA.test_two) ... ok +test_three (test.test_example.TestB.test_three) ... ERROR ----------- """ result = parse_results(self._make_result(stdout)) @@ -101,10 +101,10 @@ def test_parse_error_message(self): """Test parsing error message from traceback.""" stdout = """ Run 1 tests sequentially -test_foo (test.test_example.TestClass) ... FAIL +test_foo (test.test_example.TestClass.test_foo) ... FAIL ----------- ====================================================================== -FAIL: test_foo (test.test_example.TestClass) +FAIL: test_foo (test.test_example.TestClass.test_foo) ---------------------------------------------------------------------- Traceback (most recent call last): File "test.py", line 10, in test_foo @@ -121,11 +121,11 @@ def test_parse_multiple_error_messages(self): """Test parsing multiple error messages.""" stdout = """ Run 2 tests sequentially -test_foo (test.test_example.TestClass) ... FAIL -test_bar (test.test_example.TestClass) ... ERROR +test_foo (test.test_example.TestClass.test_foo) ... FAIL +test_bar (test.test_example.TestClass.test_bar) ... ERROR ----------- ====================================================================== -FAIL: test_foo (test.test_example.TestClass) +FAIL: test_foo (test.test_example.TestClass.test_foo) ---------------------------------------------------------------------- Traceback (most recent call last): File "test.py", line 10, in test_foo @@ -133,7 +133,7 @@ def test_parse_multiple_error_messages(self): AssertionError: 1 != 2 ====================================================================== -ERROR: test_bar (test.test_example.TestClass) +ERROR: test_bar (test.test_example.TestClass.test_bar) ---------------------------------------------------------------------- Traceback (most recent call last): File "test.py", line 20, in test_bar