@@ -475,25 +475,20 @@ class MyStr(str):
475475 pass
476476
477477 normalization_forms = ("NFC" , "NFKC" , "NFD" , "NFKD" )
478+ input_strings = (
479+ # normalized strings
480+ "" ,
481+ "ascii" ,
482+ # unnormalized strings
483+ "\u1e0b \u0323 " ,
484+ "\u0071 \u0307 \u0323 " ,
485+ )
478486
479- # normalized strings
480- empty_str = ""
481- ascii_str = "ascii"
482487 for form in normalization_forms :
483- with self .subTest (form = form ):
484- self .assertIs (type (normalize (form , empty_str )), str )
485- self .assertIs (type (normalize (form , ascii_str )), str )
486- self .assertIs (type (normalize (form , MyStr (empty_str ))), str )
487- self .assertIs (type (normalize (form , MyStr (ascii_str ))), str )
488-
489- # unnormalized strings
490- strings_to_normalize = ("\u1e0b \u0323 " , "\ufb01 " , "\u1e69 " , "\u1e9b \u0323 " )
491- for form , input_str in zip (
492- normalization_forms , strings_to_normalize , strict = True
493- ):
494- with self .subTest (form = form , input_str = input_str ):
495- self .assertIs (type (normalize (form , input_str )), str )
496- self .assertIs (type (normalize (form , MyStr (input_str ))), str )
488+ for input_str in input_strings :
489+ with self .subTest (form = form , input_str = input_str ):
490+ self .assertIs (type (normalize (form , input_str )), str )
491+ self .assertIs (type (normalize (form , MyStr (input_str ))), str )
497492
498493
499494if __name__ == "__main__" :
0 commit comments