MCPcopy Index your code
hub / github.com/python/cpython / test_contains_count_index_stop_crashes

Method test_contains_count_index_stop_crashes

Lib/test/test_deque.py:169–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

167 n in d
168
169 def test_contains_count_index_stop_crashes(self):
170 class A:
171 def __eq__(self, other):
172 d.clear()
173 return NotImplemented
174 d = deque([A(), A()])
175 with self.assertRaises(RuntimeError):
176 _ = 3 in d
177 d = deque([A(), A()])
178 with self.assertRaises(RuntimeError):
179 _ = d.count(3)
180
181 d = deque([A()])
182 with self.assertRaises(RuntimeError):
183 d.index(0)
184
185 def test_extend(self):
186 d = deque('a')

Callers

nothing calls this directly

Calls 4

AClass · 0.70
assertRaisesMethod · 0.45
countMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected