summaryrefslogtreecommitdiff
path: root/pyparsing/testing.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2022-05-30 18:00:37 -0500
committerptmcg <ptmcg@austin.rr.com>2022-05-30 18:00:37 -0500
commitb89e92442a0140aa694f8f3bd5eea9fe83b552b5 (patch)
treea4a99e00e271c5213c9a6d583dd4f09d6f2b614e /pyparsing/testing.py
parent48168419f460287ab410bf3370a6828de9d837bb (diff)
downloadpyparsing-git-b89e92442a0140aa694f8f3bd5eea9fe83b552b5.tar.gz
Convert most str.format() calls to use f-strings
Diffstat (limited to 'pyparsing/testing.py')
-rw-r--r--pyparsing/testing.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/pyparsing/testing.py b/pyparsing/testing.py
index e2dd355..2b0fcf4 100644
--- a/pyparsing/testing.py
+++ b/pyparsing/testing.py
@@ -222,7 +222,7 @@ class pyparsing_test:
)
else:
# warning here maybe?
- print("no validation for {!r}".format(test_string))
+ print(f"no validation for {test_string!r}")
# do this last, in case some specific test results can be reported instead
self.assertTrue(
@@ -304,7 +304,7 @@ class pyparsing_test:
header0 = (
lead
+ "".join(
- "{}{}".format(" " * 99, (i + 1) % 100)
+ f"{' ' * 99}{(i + 1) % 100}"
for i in range(max(max_line_len // 100, 1))
)
+ "\n"
@@ -314,10 +314,7 @@ class pyparsing_test:
header1 = (
header0
+ lead
- + "".join(
- " {}".format((i + 1) % 10)
- for i in range(-(-max_line_len // 10))
- )
+ + "".join(f" {(i + 1) % 10}" for i in range(-(-max_line_len // 10)))
+ "\n"
)
header2 = lead + "1234567890" * (-(-max_line_len // 10)) + "\n"
@@ -325,7 +322,7 @@ class pyparsing_test:
header1
+ header2
+ "\n".join(
- "{:{}d}:{}{}".format(i, lineno_width, line, eol_mark)
+ f"{i:{lineno_width}d}:{line}{eol_mark}"
for i, line in enumerate(s_lines, start=start_line)
)
+ "\n"