summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2023-08-04 15:08:54 (GMT)
committerMats Wichmann <mats@linux.com>2023-08-04 15:11:39 (GMT)
commit20e9f1ec80889ede2bd5a2d71536ae68b15a8786 (patch)
tree011553f4d98bbe6bb49417f240591fd3cdb31de6 /testing
parentf3d1936c34333b8b535269a007a5598e93029bc0 (diff)
downloadSCons-20e9f1ec80889ede2bd5a2d71536ae68b15a8786.zip
SCons-20e9f1ec80889ede2bd5a2d71536ae68b15a8786.tar.gz
SCons-20e9f1ec80889ede2bd5a2d71536ae68b15a8786.tar.bz2
More conversions: {repr(var)} -> {var!r}
Some of these got done in the tool conversion, some not, so picked up the rest manually. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r--testing/framework/TestCmd.py8
-rw-r--r--testing/framework/TestCommon.py12
2 files changed, 10 insertions, 10 deletions
diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py
index 723b9ec..48238a0 100644
--- a/testing/framework/TestCmd.py
+++ b/testing/framework/TestCmd.py
@@ -722,9 +722,9 @@ def diff_re(a, b, fromfile: str='', tofile: str='',
raise re.error(msg % (repr(s), e.args[0]))
if not expr.search(bline):
result.append(f"{i + 1}c{i + 1}")
- result.append(f"< {repr(a[i])}")
+ result.append(f"< {a[i]!r}")
result.append('---')
- result.append(f"> {repr(b[i])}")
+ result.append(f"> {b[i]!r}")
return result
@@ -1672,7 +1672,7 @@ class TestCmd:
except subprocess.TimeoutExpired:
p.terminate()
stdout, stderr = p.communicate()
-
+
# this is instead of using Popen as a context manager:
if p.stdout:
p.stdout.close()
@@ -1683,7 +1683,7 @@ class TestCmd:
p.stdin.close()
finally:
p.wait()
-
+
self.status = p.returncode
self.process = None
diff --git a/testing/framework/TestCommon.py b/testing/framework/TestCommon.py
index b0879a6..993dc02 100644
--- a/testing/framework/TestCommon.py
+++ b/testing/framework/TestCommon.py
@@ -369,7 +369,7 @@ class TestCommon(TestCmd):
title = 'output'
sys.stdout.write(f"Missing expected lines from {title}:\n")
for line in missing:
- sys.stdout.write(f" {repr(line)}\n")
+ sys.stdout.write(f" {line!r}\n")
sys.stdout.write(f"{self.banner(f'{title} ')}\n")
sys.stdout.write(output)
self.fail_test()
@@ -396,7 +396,7 @@ class TestCommon(TestCmd):
title = 'output'
sys.stdout.write(f"Unexpected number of lines from {title}:\n")
for line in counts:
- sys.stdout.write(f" {repr(line)}: found {str(counts[line])}\n")
+ sys.stdout.write(f" {line!r}: found {str(counts[line])}\n")
sys.stdout.write(f"{self.banner(f'{title} ')}\n")
sys.stdout.write(output)
self.fail_test()
@@ -420,7 +420,7 @@ class TestCommon(TestCmd):
title = 'output'
sys.stdout.write(f"Missing any expected line from {title}:\n")
for line in lines:
- sys.stdout.write(f" {repr(line)}\n")
+ sys.stdout.write(f" {line!r}\n")
sys.stdout.write(f"{self.banner(f'{title} ')}\n")
sys.stdout.write(output)
self.fail_test()
@@ -463,12 +463,12 @@ class TestCommon(TestCmd):
if missing:
sys.stdout.write(f"Missing expected lines from {title}:\n")
for line in missing:
- sys.stdout.write(f" {repr(line)}\n")
+ sys.stdout.write(f" {line!r}\n")
sys.stdout.write(f"{self.banner(f'Missing {title} ')}\n")
if out:
sys.stdout.write(f"Extra unexpected lines from {title}:\n")
for line in out:
- sys.stdout.write(f" {repr(line)}\n")
+ sys.stdout.write(f" {line!r}\n")
sys.stdout.write(f"{self.banner(f'Extra {title} ')}\n")
sys.stdout.flush()
self.fail_test()
@@ -582,7 +582,7 @@ class TestCommon(TestCmd):
title = 'output'
sys.stdout.write(f"Unexpected lines in {title}:\n")
for line in unexpected:
- sys.stdout.write(f" {repr(line)}\n")
+ sys.stdout.write(f" {line!r}\n")
sys.stdout.write(f"{self.banner(f'{title} ')}\n")
sys.stdout.write(output)
self.fail_test()