From: Stepan Sindelar Date: Wed, 7 Apr 2021 23:31:55 +0000 (+0200) Subject: Fix broken test for MutableSet.pop() (GH-25209) X-Git-Tag: v3.10.0b1~366 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=453074c8daf996b1815a0cd2218f0dbf1801056c;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 30303f00ba5c..7b245c08b5dd 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -1512,8 +1512,12 @@ class TestCollectionABCs(ABCTestCase): 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()