summaryrefslogtreecommitdiff
path: root/Lib/test/test_weakset.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-03 07:55:44 +0000
committerGeorg Brandl <georg@python.org>2010-12-03 07:55:44 +0000
commitf8de3fea1280d55377d40c6e04b64114f9da2fa6 (patch)
treebf723ad86ffcf6bdc2550fe6304fd384d9445e08 /Lib/test/test_weakset.py
parent3b9406b08aad04c1f92d7a2ab03c8a42c3afb8be (diff)
downloadcpython-git-f8de3fea1280d55377d40c6e04b64114f9da2fa6.tar.gz
#10360: catch TypeError in WeakSet.__contains__, just like WeakKeyDictionary does.
Diffstat (limited to 'Lib/test/test_weakset.py')
-rw-r--r--Lib/test/test_weakset.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_weakset.py b/Lib/test/test_weakset.py
index fe68b665c8..58a1f8790a 100644
--- a/Lib/test/test_weakset.py
+++ b/Lib/test/test_weakset.py
@@ -50,7 +50,8 @@ class TestWeakSet(unittest.TestCase):
def test_contains(self):
for c in self.letters:
self.assertEqual(c in self.s, c in self.d)
- self.assertRaises(TypeError, self.s.__contains__, [[]])
+ # 1 is not weakref'able, but that TypeError is caught by __contains__
+ self.assertNotIn(1, self.s)
self.assertIn(self.obj, self.fs)
del self.obj
self.assertNotIn(ustr('F'), self.fs)