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
226b2303
Commit
226b2303
authored
Mar 20, 2010
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up the warnings filter use in test_unicode.
parent
e1adeceb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+10
-16
No files found.
Lib/test/test_unicode.py
View file @
226b2303
...
...
@@ -31,18 +31,11 @@ def search_function(encoding):
return
None
codecs
.
register
(
search_function
)
class
UnicodeTest
(
string_tests
.
CommonTest
,
string_tests
.
MixinStrUnicodeUserStringTest
,
string_tests
.
MixinStrUnicodeTest
,
):
type2test
=
str
def
setUp
(
self
):
self
.
warning_filters
=
warnings
.
filters
[:]
class
UnicodeTest
(
string_tests
.
CommonTest
,
string_tests
.
MixinStrUnicodeUserStringTest
,
string_tests
.
MixinStrUnicodeTest
):
def
tearDown
(
self
):
warnings
.
filters
=
self
.
warning_filters
type2test
=
str
def
checkequalnofix
(
self
,
result
,
object
,
methodname
,
*
args
):
method
=
getattr
(
object
,
methodname
)
...
...
@@ -283,11 +276,12 @@ class UnicodeTest(
self
.
assertRaises
(
TypeError
,
'replace'
.
replace
,
"r"
,
42
)
def
test_bytes_comparison
(
self
):
warnings
.
simplefilter
(
'ignore'
,
BytesWarning
)
self
.
assertEqual
(
'abc'
==
b'abc'
,
False
)
self
.
assertEqual
(
'abc'
!=
b'abc'
,
True
)
self
.
assertEqual
(
'abc'
==
bytearray
(
b'abc'
),
False
)
self
.
assertEqual
(
'abc'
!=
bytearray
(
b'abc'
),
True
)
with
support
.
check_warnings
():
warnings
.
simplefilter
(
'ignore'
,
BytesWarning
)
self
.
assertEqual
(
'abc'
==
b'abc'
,
False
)
self
.
assertEqual
(
'abc'
!=
b'abc'
,
True
)
self
.
assertEqual
(
'abc'
==
bytearray
(
b'abc'
),
False
)
self
.
assertEqual
(
'abc'
!=
bytearray
(
b'abc'
),
True
)
def
test_comparison
(
self
):
# Comparisons:
...
...
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