mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue 7832. Deprecating assertSameElements in Py3k.
This commit is contained in:
parent
8442a606b8
commit
91c9da34bc
2 changed files with 7 additions and 23 deletions
|
@ -700,10 +700,9 @@ class TestCase(object):
|
|||
msg: Optional message to use on failure instead of a list of
|
||||
differences.
|
||||
|
||||
For more general containership equality, assertSameElements will work
|
||||
with things other than sets. This uses ducktyping to support
|
||||
different types of sets, and is optimized for sets specifically
|
||||
(parameters must support a difference method).
|
||||
assertSetEqual uses ducktyping to support different types of sets, and
|
||||
is optimized for sets specifically (parameters must support a
|
||||
difference method).
|
||||
"""
|
||||
try:
|
||||
difference1 = set1.difference(set2)
|
||||
|
@ -809,6 +808,8 @@ class TestCase(object):
|
|||
set(actual))`` but it works with sequences of unhashable objects as
|
||||
well.
|
||||
"""
|
||||
warnings.warn('assertSameElements is deprecated',
|
||||
DeprecationWarning)
|
||||
try:
|
||||
expected = set(expected_seq)
|
||||
actual = set(actual_seq)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue