(self)
| 1266 | self.assertRaises(InvalidOperation, cursor.comment, "hello") |
| 1267 | |
| 1268 | def test_alive(self): |
| 1269 | self.db.test.delete_many({}) |
| 1270 | self.db.test.insert_many([{} for _ in range(3)]) |
| 1271 | self.addCleanup(self.db.test.delete_many, {}) |
| 1272 | cursor = self.db.test.find().batch_size(2) |
| 1273 | n = 0 |
| 1274 | while True: |
| 1275 | cursor.next() |
| 1276 | n += 1 |
| 1277 | if n == 3: |
| 1278 | self.assertFalse(cursor.alive) |
| 1279 | break |
| 1280 | |
| 1281 | self.assertTrue(cursor.alive) |
| 1282 | |
| 1283 | def test_close_kills_cursor_synchronously(self): |
| 1284 | # Kill any cursors possibly queued up by previous tests. |
nothing calls this directly
no test coverage detected