(self)
| 147 | self.assertEqual(x >= y, list(x) >= list(y), (x,y)) |
| 148 | |
| 149 | def test_contains(self): |
| 150 | n = 200 |
| 151 | |
| 152 | d = deque(range(n)) |
| 153 | for i in range(n): |
| 154 | self.assertTrue(i in d) |
| 155 | self.assertTrue((n+1) not in d) |
| 156 | |
| 157 | # Test detection of mutation during iteration |
| 158 | d = deque(range(n)) |
| 159 | d[n//2] = MutateCmp(d, False) |
| 160 | with self.assertRaises(RuntimeError): |
| 161 | n in d |
| 162 | |
| 163 | # Test detection of comparison exceptions |
| 164 | d = deque(range(n)) |
| 165 | d[n//2] = BadCmp() |
| 166 | with self.assertRaises(RuntimeError): |
| 167 | n in d |
| 168 | |
| 169 | def test_contains_count_index_stop_crashes(self): |
| 170 | class A: |
nothing calls this directly
no test coverage detected