Fix broken test for MutableSet.pop() (GH-25209)

Changes the test to not assert concrete result of pop, but just that it
was an item from the set, and that the set shrunk by one.
This commit is contained in:
Stepan Sindelar 2021-04-08 01:31:55 +02:00 committed by GitHub
parent 3f3d82b848
commit 453074c8da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1512,8 +1512,12 @@ def discard(self,v):
return result
def __repr__(self):
return "MySet(%s)" % repr(list(self))
s = MySet([5,43,2,1])
self.assertEqual(s.pop(), 1)
items = [5,43,2,1]
s = MySet(items)
r = s.pop()
self.assertEquals(len(s), len(items) - 1)
self.assertNotIn(r, s)
self.assertIn(r, items)
def test_issue8750(self):
empty = WithSet()