summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-04-07 23:56:48 (GMT)
committerGitHub <noreply@github.com>2021-04-07 23:56:48 (GMT)
commitb3e8722853c25fa03ae0e3b74513498ce19ea10c (patch)
treea3ca112c60b988b875ddd0211e26fb43fe942dae
parent3b1cf202976d9590d5b453c47b883f2e7cd1a7a5 (diff)
downloadcpython-b3e8722853c25fa03ae0e3b74513498ce19ea10c.zip
cpython-b3e8722853c25fa03ae0e3b74513498ce19ea10c.tar.gz
cpython-b3e8722853c25fa03ae0e3b74513498ce19ea10c.tar.bz2
Fix broken test for MutableSet.pop() (GH-25209) (GH-25269)
-rw-r--r--Lib/test/test_collections.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 3ff660c..6a81935 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -1502,8 +1502,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()