mtest: Use textrwap.dedent for large block

This allows editors like vim to properly fold the code, and makes it
generally easier to read.
This commit is contained in:
Dylan Baker 2020-04-21 14:13:25 -07:00
parent 959c1becd6
commit 4dcbb9254a
1 changed files with 9 additions and 8 deletions

View File

@ -33,6 +33,7 @@ import signal
import subprocess import subprocess
import sys import sys
import tempfile import tempfile
import textwrap
import time import time
import typing as T import typing as T
@ -775,14 +776,14 @@ class TestHarness:
write_json_log(self.jsonlogfile, name, result) write_json_log(self.jsonlogfile, name, result)
def print_summary(self) -> None: def print_summary(self) -> None:
msg = ''' msg = textwrap.dedent('''
Ok: {:<4} Ok: {:<4}
Expected Fail: {:<4} Expected Fail: {:<4}
Fail: {:<4} Fail: {:<4}
Unexpected Pass: {:<4} Unexpected Pass: {:<4}
Skipped: {:<4} Skipped: {:<4}
Timeout: {:<4} Timeout: {:<4}
'''.format(self.success_count, self.expectedfail_count, self.fail_count, ''').format(self.success_count, self.expectedfail_count, self.fail_count,
self.unexpectedpass_count, self.skip_count, self.timeout_count) self.unexpectedpass_count, self.skip_count, self.timeout_count)
print(msg) print(msg)
if self.logfile: if self.logfile: