@@ -144,9 +144,9 @@ def _check_err_rep(
144
144
assert whitespace .search (err ) is None , f"error { err !r} has whitespace"
145
145
assert "," not in err , f"error { err !r} has a comma"
146
146
assert len (rep ) > 0 , f"error { err } : correction { rep !r} must be non-empty"
147
- assert not start_whitespace .match (
148
- rep
149
- ), f"error { err } : correction { rep !r } cannot start with whitespace"
147
+ assert not start_whitespace .match (rep ), (
148
+ f"error { err } : correction { rep !r } cannot start with whitespace"
149
+ )
150
150
_check_aspell (err , f"error { err !r} " , in_aspell [0 ], fname , languages [0 ])
151
151
prefix = f"error { err } : correction { rep !r} "
152
152
for regex , msg in (
@@ -166,9 +166,9 @@ def _check_err_rep(
166
166
assert not regex .search (rep ), msg % (prefix ,)
167
167
del msg
168
168
if rep .count ("," ):
169
- assert rep .endswith (
170
- ","
171
- ), f'error { err } : multiple corrections must end with trailing ","'
169
+ assert rep .endswith ("," ), (
170
+ f'error { err } : multiple corrections must end with trailing ","'
171
+ )
172
172
reps = [r .strip () for r in rep .split ("," )]
173
173
reps = [r for r in reps if len (r )]
174
174
for r in reps :
@@ -185,9 +185,9 @@ def _check_err_rep(
185
185
# we could ignore the case, but that would miss things like days of the
186
186
# week which we want to be correct
187
187
reps = [r .lower () for r in reps ]
188
- assert len (set (reps )) == len (
189
- reps
190
- ), f'error { err } : corrections " { rep } " are not (lower-case) unique'
188
+ assert len (set (reps )) == len (reps ), (
189
+ f'error { err } : corrections " { rep } " are not (lower-case) unique'
190
+ )
191
191
192
192
193
193
@pytest .mark .parametrize (
@@ -307,18 +307,18 @@ def test_dictionary_looping(
307
307
for line in fid :
308
308
err , rep = line .split ("->" )
309
309
err = err .lower ()
310
- assert (
311
- err not in this_err_dict
312
- ), f"error { err !r } already exists in { short_fname } "
310
+ assert err not in this_err_dict , (
311
+ f"error { err !r } already exists in { short_fname } "
312
+ )
313
313
rep = rep .rstrip ("\n " )
314
314
reps = [r .strip () for r in rep .lower ().split ("," )]
315
315
reps = [r for r in reps if len (r )]
316
316
this_err_dict [err ] = reps
317
317
# 1. check the dict against itself (diagonal)
318
318
for err , reps in this_err_dict .items ():
319
- assert word_regex .fullmatch (
320
- err
321
- ), f"error { err !r } does not match default word regex ' { word_regex_def } '"
319
+ assert word_regex .fullmatch (err ), (
320
+ f"error { err !r } does not match default word regex ' { word_regex_def } '"
321
+ )
322
322
for r in reps :
323
323
assert r not in this_err_dict , (
324
324
f"error { err } : correction { r } is an error itself "
0 commit comments