File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,8 +115,10 @@ def test_specific(self):
115115 '' ),
116116 ]
117117
118- for input , output in TESTS :
119- self .failUnlessEqual (unidecode (input ), output )
118+ for input , correct_output in TESTS :
119+ test_output = unidecode (input )
120+ self .failUnlessEqual (test_output , correct_output )
121+ self .failUnless (isinstance (test_output , str ))
120122
121123 @unittest .skipIf (sys .maxunicode < 0x10000 , "narrow build" )
122124 def test_specific_wide (self ):
@@ -131,8 +133,10 @@ def test_specific_wide(self):
131133 'km/h' ),
132134 ]
133135
134- for input , output in TESTS :
135- self .failUnlessEqual (unidecode (input ), output )
136+ for input , correct_output in TESTS :
137+ test_output = unidecode (input )
138+ self .failUnlessEqual (test_output , correct_output )
139+ self .failUnless (isinstance (test_output , str ))
136140
137141if __name__ == "__main__" :
138142 unittest .main ()
Original file line number Diff line number Diff line change @@ -101,8 +101,10 @@ def test_specific(self):
101101 '' ),
102102 ]
103103
104- for instr , output in TESTS :
105- self .failUnlessEqual (unidecode (instr ), output )
104+ for instr , correct_output in TESTS :
105+ test_output = unidecode (instr )
106+ self .failUnlessEqual (test_output , correct_output )
107+ self .failUnless (isinstance (test_output , str ))
106108
107109 @unittest .skipIf (sys .maxunicode < 0x10000 , "narrow build" )
108110 def test_specific_wide (self ):
@@ -117,5 +119,7 @@ def test_specific_wide(self):
117119 'km/h' ),
118120 ]
119121
120- for instr , output in TESTS :
121- self .failUnlessEqual (unidecode (instr ), output )
122+ for instr , correct_output in TESTS :
123+ test_output = unidecode (instr )
124+ self .failUnlessEqual (test_output , correct_output )
125+ self .failUnless (isinstance (test_output , str ))
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def unidecode(string):
2828 codepoint = ord (char )
2929
3030 if codepoint < 0x80 : # Basic ASCII
31- retval .append (char )
31+ retval .append (str ( char ) )
3232 continue
3333
3434 if codepoint > 0xeffff :
You can’t perform that action at this time.
0 commit comments