(self)
| 298 | |
| 299 | @no_type_check |
| 300 | def test_iteration(self): |
| 301 | with self.change_stream(batch_size=2) as change_stream: |
| 302 | num_inserted = 10 |
| 303 | self.watched_collection().insert_many([{} for _ in range(num_inserted)]) |
| 304 | inserts_received = 0 |
| 305 | for change in change_stream: |
| 306 | self.assertEqual(change["operationType"], "insert") |
| 307 | inserts_received += 1 |
| 308 | if inserts_received == num_inserted: |
| 309 | break |
| 310 | self._test_invalidate_stops_iteration(change_stream) |
| 311 | |
| 312 | @no_type_check |
| 313 | @client_context.require_sync |
nothing calls this directly
no test coverage detected