Handle logging.info at matter_testing_support.py (#36070)
* Handle logging.info at matter_testing_support.py
* Move self.print_step instruction
* restyled
diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py
index 2d23a9f..b16d1b4 100644
--- a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py
+++ b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py
@@ -1429,8 +1429,7 @@
# TODO: I very much do not want to have people passing in strings here. Do we really need the expression
# as a string? Does it get used by the TH?
self.runner_hook.step_skipped(name=str(num), expression="")
- else:
- logging.info(f'**** Skipping: {num}')
+ logging.info(f'**** Skipping: {num}')
self.step_skipped = True
def skip_step(self, step):
@@ -1465,6 +1464,8 @@
asserts.fail(f'Unexpected test step: {step} - steps not called in order, or step does not exist')
current_step = steps[self.current_step_index]
+ self.print_step(step, current_step.description, endpoint)
+
if self.runner_hook:
# If we've reached the next step with no assertion and the step wasn't skipped, it passed
if not self.step_skipped and self.current_step_index != 0:
@@ -1477,11 +1478,7 @@
# TODO: it seems like the step start should take a number and a name
name = f'{step} : {current_step.description}'
- self.print_step(step, current_step.description, endpoint)
self.runner_hook.step_start(name=name, endpoint=current_step.endpoint)
- else:
- self.print_step(step, current_step.description)
-
self.step_start_time = datetime.now(tz=timezone.utc)
self.current_step_index += 1
self.step_skipped = False