# HG changeset patch # Parent b0361945c44fafce3f19c277513ff17cc0a6b365 # User Jezreel Ng Modify test to account for arbitrary element return order. diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -513,19 +513,17 @@ class TestCollectionABCs(ABCTestCase): 'add', 'discard') def test_issue_5647(self): # MutableSet.__iand__ mutated the set during iteration s = WithSet('abcd') s &= WithSet('cdef') # This used to fail self.assertEqual(set(s), set('cd')) - @unittest.skipIf(test_support.is_jython, "FIXME: doesn't work in Jython") def test_issue_4920(self): - # MutableSet.pop() method did not work class MySet(collections.MutableSet): __slots__=['__s'] def __init__(self,items=None): if items is None: items=[] self.__s=set(items) def __contains__(self,v): return v in self.__s @@ -538,18 +536,19 @@ class TestCollectionABCs(ABCTestCase): self.__s.add(v) return result def discard(self,v): result=v in self.__s self.__s.discard(v) return result def __repr__(self): return "MySet(%s)" % repr(list(self)) - s = MySet([5,43,2,1]) - self.assertEqual(s.pop(), 1) + values = [5,43,2,1] + s = MySet(values) + self.assertIn(s.pop(), values) def test_issue8750(self): empty = WithSet() full = WithSet(range(10)) s = WithSet(full) s -= s self.assertEqual(s, empty) s = WithSet(full)