Skip to content

Commit 741e891

Browse files
[wptrunner] Log subsuites with quotation marks
The default subsuite is the empty string, which, when logged, looks incomplete, e.g: ``` INFO Restarting browser for new subsuite: ``` Format with `repr()` to add quotation marks.
1 parent 8c2b688 commit 741e891

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/wptrunner/wptrunner/testrunner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def group(self) -> testloader.TestGroup:
313313
if not self.current_group.group or len(self.current_group.group) == 0:
314314
try:
315315
self.current_group = self.test_queue.get()
316-
self.logger.debug(f"Got new test group subsuite:{self.current_group[1]} "
316+
self.logger.debug(f"Got new test group subsuite:{self.current_group[1]!r} "
317317
f"test_type:{self.current_group[2]}")
318318
except Empty:
319319
return testloader.TestGroup(None, None, None, None)
@@ -473,11 +473,11 @@ def _cleanup_run_loop(self):
473473

474474
if skipped_tests:
475475
self.logger.critical(
476-
f"Tests left in the queue: {subsuite}:{skipped_tests[0].id!r} "
476+
f"Tests left in the queue: {subsuite!r}:{skipped_tests[0].id!r} "
477477
f"and {len(skipped_tests) - 1} others"
478478
)
479479
for test in skipped_tests[1:]:
480-
self.logger.debug(f"Test left in the queue: {subsuite}:{test.id!r}")
480+
self.logger.debug(f"Test left in the queue: {subsuite!r}:{test.id!r}")
481481

482482
force_stop = (not isinstance(self.state, RunnerManagerState.stop) or
483483
self.state.force_stop)
@@ -900,7 +900,7 @@ def after_test_end(self, test, restart, force_rerun=False, force_stop=False):
900900
if test is None:
901901
return RunnerManagerState.stop(force_stop)
902902
if subsuite != self.state.subsuite:
903-
self.logger.info(f"Restarting browser for new subsuite:{subsuite}")
903+
self.logger.info(f"Restarting browser for new subsuite:{subsuite!r}")
904904
restart = True
905905
elif self.restart_on_new_group and test_group is not self.state.test_group:
906906
self.logger.info("Restarting browser for new test group")

0 commit comments

Comments
 (0)