mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-95144: Improve error message of ... in None
(GH-119888)
This commit is contained in:
parent
65fededf9c
commit
dc03ce797a
4 changed files with 18 additions and 5 deletions
|
@ -24,8 +24,11 @@ class TestContains(unittest.TestCase):
|
|||
self.assertNotIn(0, b)
|
||||
self.assertIn(1, c)
|
||||
self.assertNotIn(0, c)
|
||||
self.assertRaises(TypeError, lambda: 1 in a)
|
||||
self.assertRaises(TypeError, lambda: 1 not in a)
|
||||
msg = "argument of type 'base_set' is not a container or iterable"
|
||||
with self.assertRaisesRegex(TypeError, msg):
|
||||
1 in a
|
||||
with self.assertRaisesRegex(TypeError, msg):
|
||||
1 not in a
|
||||
|
||||
# test char in string
|
||||
self.assertIn('c', 'abc')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue