Skip to content

Commit

Permalink
Fix 66ec667
Browse files Browse the repository at this point in the history
I had tried to change string formatting from format() to f-strings.
Unfortunately, `!r`, which means `repr()`, does not seem to be valid
in f-strings. So call `repr()` explictly.
  • Loading branch information
DimitriPapadopoulos committed Apr 26, 2023
1 parent bc52bd8 commit 52851cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codespell_lib/tests/test_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_dictionary_looping(
err = err.lower()
assert (
err not in this_err_dict
), f"error {err:!r} already exists in {short_fname}"
), f"error {repr(err)} already exists in {short_fname}"
rep = rep.rstrip("\n")
reps = [r.strip() for r in rep.lower().split(",")]
reps = [r for r in reps if len(r)]
Expand All @@ -298,15 +298,15 @@ def test_dictionary_looping(
# error duplication (eventually maybe we should just merge?)
for err in this_err_dict:
assert err not in other_err_dict, (
f"error {err:!r} in dictionary {short_fname} "
f"error {repr(err)} in dictionary {short_fname} "
f"already exists in dictionary {other_fname}"
)
# 2. check corrections in this dict against other dicts (upper)
pair = (short_fname, other_fname)
if pair not in allowed_dups:
for err in this_err_dict:
assert err not in other_err_dict, (
f"error {err:!r} in dictionary {short_fname} "
f"error {repr(err)} in dictionary {short_fname} "
f"already exists in dictionary {other_fname}"
)
for r in this_err_dict[err]:
Expand Down

0 comments on commit 52851cf

Please sign in to comment.