mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Patch for Py3k with fallback for comparing unsortable sequences in
assertSameElements. Removed the expected failure and added another test case to confirm that this patch works for unsortable sequences that are the same (no fail) and different (fail). Issue #2578
This commit is contained in:
parent
270a9ceb5b
commit
a5809c84b3
2 changed files with 25 additions and 5 deletions
|
@ -2392,8 +2392,6 @@ class Test_TestCase(TestCase, TestEquality, TestHashing):
|
|||
self.assertRaises(self.failureException, self.assertEqual, a, b,
|
||||
msg='foo')
|
||||
|
||||
# The fact that dictionaries are unorderable breaks this test for them.
|
||||
@unittest.expectedFailure
|
||||
def testEquality(self):
|
||||
self.assertListEqual([], [])
|
||||
self.assertTupleEqual((), ())
|
||||
|
@ -2459,6 +2457,8 @@ class Test_TestCase(TestCase, TestEquality, TestHashing):
|
|||
self.assertSameElements([{'a': 1}, {'b': 2}], [{'b': 2}, {'a': 1}])
|
||||
self.assertRaises(self.failureException, self.assertSameElements,
|
||||
[[1]], [[2]])
|
||||
self.assertRaises(self.failureException, self.assertSameElements,
|
||||
[{'a': 1}, {'b': 2}], [{'b': 2}, {'a': 2}])
|
||||
|
||||
def testAssertSetEqual(self):
|
||||
set1 = set()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue