Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
51e243f2
Commit
51e243f2
authored
Feb 20, 2013
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence DeprecationWarnings in test_unicode.
parent
795c10b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+11
-9
No files found.
Lib/test/test_unicode.py
View file @
51e243f2
...
...
@@ -2172,15 +2172,17 @@ class UnicodeTest(string_tests.CommonTest,
# generate a fresh string (refcount=1)
text
=
'a'
*
length
+
'b'
# fill wstr internal field
abc
=
text
.
encode
(
'unicode_internal'
)
self
.
assertEqual
(
abc
.
decode
(
'unicode_internal'
),
text
)
# resize text: wstr field must be cleared and then recomputed
text
+=
'c'
abcdef
=
text
.
encode
(
'unicode_internal'
)
self
.
assertNotEqual
(
abc
,
abcdef
)
self
.
assertEqual
(
abcdef
.
decode
(
'unicode_internal'
),
text
)
with
support
.
check_warnings
((
'unicode_internal codec has been '
'deprecated'
,
DeprecationWarning
)):
# fill wstr internal field
abc
=
text
.
encode
(
'unicode_internal'
)
self
.
assertEqual
(
abc
.
decode
(
'unicode_internal'
),
text
)
# resize text: wstr field must be cleared and then recomputed
text
+=
'c'
abcdef
=
text
.
encode
(
'unicode_internal'
)
self
.
assertNotEqual
(
abc
,
abcdef
)
self
.
assertEqual
(
abcdef
.
decode
(
'unicode_internal'
),
text
)
class
StringModuleTest
(
unittest
.
TestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment