Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 3, 2023
1 parent 3c35a1c commit 59e549f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ def check_for_matching_groups(self, regexes, examples):
self.assertIn(
"reporter",
m.groupdict(),
"<reporter> group missing in regex %s" % regex,
f"<reporter> group missing in regex {regex}",
)
self.assertIn(
"page",
m.groupdict(),
"<page> group missing in regex %s" % regex,
f"<page> group missing in regex {regex}",
)
continue

Expand All @@ -163,7 +163,7 @@ def test_json_format(self):
tofile="expected.json",
)
self.fail(
("%s needs reformatting. " % self.json_name)
f"{self.json_name} needs reformatting. "
+ "Run with env var FIX_JSON=1 to update the file automatically. "
+ "Diff of actual vs. expected:\n"
+ "\n".join(diff)
Expand Down Expand Up @@ -201,7 +201,7 @@ def check_ascii(self, obj):
def check_whitespace(self, obj):
for s in emit_strings(obj):
self.assertEqual(
s.strip(), s, msg="Field needs whitespace stripped: '%s'" % s
s.strip(), s, msg=f"Field needs whitespace stripped: '{s}'"
)
non_space_whitespace = any(w != " " for w in re.findall(r"\s+", s))
self.assertFalse(
Expand All @@ -227,7 +227,7 @@ def test_any_keys_missing_editions(self):
self.assertIn(
reporter_abbv,
reporter_data["editions"],
msg="Could not find edition for key: %s" % reporter_abbv,
msg=f"Could not find edition for key: {reporter_abbv}",
)

def test_for_variations_mapping_to_bad_keys(self):
Expand Down Expand Up @@ -268,7 +268,7 @@ def test_all_reporters_have_valid_cite_type(self):
self.assertIn(
reporter_data["cite_type"],
VALID_CITE_TYPES,
"%s did not have a valid cite_type value" % reporter_abbv,
f"{reporter_abbv} did not have a valid cite_type value",
)

def test_no_variation_is_same_as_key(self):
Expand Down

0 comments on commit 59e549f

Please sign in to comment.