[Python-checkins] Fix broken test for MutableSet.pop() (GH-25209) (GH-25269)
rhettinger
webhook-mailer at python.org
Wed Apr 7 19:56:55 EDT 2021
https://github.com/python/cpython/commit/b3e8722853c25fa03ae0e3b74513498ce19ea10c
commit: b3e8722853c25fa03ae0e3b74513498ce19ea10c
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: rhettinger <rhettinger at users.noreply.github.com>
date: 2021-04-07T16:56:48-07:00
summary:
Fix broken test for MutableSet.pop() (GH-25209) (GH-25269)
files:
M Lib/test/test_collections.py
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 3ff660cf7a37b..6a819358fe89f 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -1502,8 +1502,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()
More information about the Python-checkins
mailing list