Move to f-strings
Used: $ flynt -a -tc . vppcfg Execution time: 0.216s Files checked: 24 Files modified: 13 Character count reduction: 632 (0.36%) Per expression type: Old style (`%`) expressions attempted: 209/211 (99.1%) No `.format(...)` calls attempted. No concatenations attempted. F-string expressions created: 205 Ran an integration test before and after. No diffs.
This commit is contained in:
4
tests.py
4
tests.py
@ -79,7 +79,7 @@ class YAMLTest(unittest.TestCase):
|
||||
this_msg_expected = True
|
||||
break
|
||||
if not this_msg_expected:
|
||||
print("%s: Unexpected message: %s" % (self.yaml_filename, m), file=sys.stderr)
|
||||
print(f"{self.yaml_filename}: Unexpected message: {m}", file=sys.stderr)
|
||||
fail = True
|
||||
|
||||
count = 0
|
||||
@ -87,7 +87,7 @@ class YAMLTest(unittest.TestCase):
|
||||
count = unittest['test']['errors']['count']
|
||||
|
||||
if len(msgs) != count:
|
||||
print("%s: Unexpected error count %d (expecting %d)" % (self.yaml_filename, len(msgs), count), file=sys.stderr)
|
||||
print(f"{self.yaml_filename}: Unexpected error count {len(msgs)} (expecting {int(count)})", file=sys.stderr)
|
||||
self.assertEqual(len(msgs), count)
|
||||
self.assertFalse(fail)
|
||||
|
||||
|
Reference in New Issue
Block a user