mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Silence more py3k warnings in unittest.case.
This commit is contained in:
parent
236da4be4e
commit
4a0f8b89f6
1 changed files with 2 additions and 2 deletions
|
@ -568,7 +568,7 @@ class TestCase(object):
|
||||||
msg: Optional message to use on failure instead of a list of
|
msg: Optional message to use on failure instead of a list of
|
||||||
differences.
|
differences.
|
||||||
"""
|
"""
|
||||||
if seq_type != None:
|
if seq_type is not None:
|
||||||
seq_type_name = seq_type.__name__
|
seq_type_name = seq_type.__name__
|
||||||
if not isinstance(seq1, seq_type):
|
if not isinstance(seq1, seq_type):
|
||||||
raise self.failureException('First sequence is not a %s: %s'
|
raise self.failureException('First sequence is not a %s: %s'
|
||||||
|
@ -802,7 +802,7 @@ class TestCase(object):
|
||||||
with warnings.catch_warnings():
|
with warnings.catch_warnings():
|
||||||
if sys.py3kwarning:
|
if sys.py3kwarning:
|
||||||
# Silence Py3k warning raised during the sorting
|
# Silence Py3k warning raised during the sorting
|
||||||
for _msg in ["dict inequality comparisons",
|
for _msg in ["(code|dict|type) inequality comparisons",
|
||||||
"builtin_function_or_method order comparisons",
|
"builtin_function_or_method order comparisons",
|
||||||
"comparing unequal types"]:
|
"comparing unequal types"]:
|
||||||
warnings.filterwarnings("ignore", _msg, DeprecationWarning)
|
warnings.filterwarnings("ignore", _msg, DeprecationWarning)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue