From fa828030a316f2161174ebe18d2af0ff6689795d Mon Sep 17 00:00:00 2001 From: Hilton Lima Date: Tue, 17 Sep 2024 12:15:48 +0000 Subject: [PATCH] Fix hocks step_ functions --- .../sdk_tests/support/python_testing/models/test_case.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_collections/matter/sdk_tests/support/python_testing/models/test_case.py b/test_collections/matter/sdk_tests/support/python_testing/models/test_case.py index c39ff974..c31e646a 100644 --- a/test_collections/matter/sdk_tests/support/python_testing/models/test_case.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/test_case.py @@ -90,7 +90,8 @@ def step_over(self) -> None: # Python tests that don't follow the template only have the default steps "Start # Python test" and "Show test logs", but inside the file there can be more than # one test case, so the hooks' step methods will continue to be called - if len(self.test_steps) == 2: + if self.python_test.python_test_type == PythonTestType.LEGACY: + # REMOVE if len(self.test_steps) == 2: return self.next_step() @@ -133,7 +134,8 @@ def step_failure( # tests can fail and so this method will be called for each of them. These # failures should be reported in the first step and moving to the logs step # should only happen after all test cases are executed. - if len(self.test_steps) > 2: + if self.python_test.python_test_type != PythonTestType.LEGACY: + # REMOVE if len(self.test_steps) > 2: # Python tests stop when there's a failure. We need to skip the next steps # and execute only the last one, which shows the logs self.skip_to_last_step()