@@ -144,9 +144,9 @@ def _check_err_rep(
144144 assert whitespace .search (err ) is None , f"error { err !r} has whitespace"
145145 assert "," not in err , f"error { err !r} has a comma"
146146 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+ )
150150 _check_aspell (err , f"error { err !r} " , in_aspell [0 ], fname , languages [0 ])
151151 prefix = f"error { err } : correction { rep !r} "
152152 for regex , msg in (
@@ -166,9 +166,9 @@ def _check_err_rep(
166166 assert not regex .search (rep ), msg % (prefix ,)
167167 del msg
168168 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+ )
172172 reps = [r .strip () for r in rep .split ("," )]
173173 reps = [r for r in reps if len (r )]
174174 for r in reps :
@@ -185,9 +185,9 @@ def _check_err_rep(
185185 # we could ignore the case, but that would miss things like days of the
186186 # week which we want to be correct
187187 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+ )
191191
192192
193193@pytest .mark .parametrize (
@@ -307,18 +307,18 @@ def test_dictionary_looping(
307307 for line in fid :
308308 err , rep = line .split ("->" )
309309 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+ )
313313 rep = rep .rstrip ("\n " )
314314 reps = [r .strip () for r in rep .lower ().split ("," )]
315315 reps = [r for r in reps if len (r )]
316316 this_err_dict [err ] = reps
317317 # 1. check the dict against itself (diagonal)
318318 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+ )
322322 for r in reps :
323323 assert r not in this_err_dict , (
324324 f"error { err } : correction { r } is an error itself "
0 commit comments