File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2172,15 +2172,17 @@ def test_resize(self):
21722172 # generate a fresh string (refcount=1)
21732173 text = 'a' * length + 'b'
21742174
2175- # fill wstr internal field
2176- abc = text .encode ('unicode_internal' )
2177- self .assertEqual (abc .decode ('unicode_internal' ), text )
2178-
2179- # resize text: wstr field must be cleared and then recomputed
2180- text += 'c'
2181- abcdef = text .encode ('unicode_internal' )
2182- self .assertNotEqual (abc , abcdef )
2183- self .assertEqual (abcdef .decode ('unicode_internal' ), text )
2175+ with support .check_warnings (('unicode_internal codec has been '
2176+ 'deprecated' , DeprecationWarning )):
2177+ # fill wstr internal field
2178+ abc = text .encode ('unicode_internal' )
2179+ self .assertEqual (abc .decode ('unicode_internal' ), text )
2180+
2181+ # resize text: wstr field must be cleared and then recomputed
2182+ text += 'c'
2183+ abcdef = text .encode ('unicode_internal' )
2184+ self .assertNotEqual (abc , abcdef )
2185+ self .assertEqual (abcdef .decode ('unicode_internal' ), text )
21842186
21852187
21862188class StringModuleTest (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments