(self)
| 673 | self._test_ops(client, (explicit_close, [], {})) |
| 674 | |
| 675 | def test_aggregate_error(self): |
| 676 | listener = self.listener |
| 677 | client = self.client |
| 678 | coll = client.pymongo_test.collection |
| 679 | # 3.6.0 mongos only validates the aggregate pipeline when the |
| 680 | # database exists. |
| 681 | coll.insert_one({}) |
| 682 | listener.reset() |
| 683 | |
| 684 | with self.assertRaises(OperationFailure): |
| 685 | coll.aggregate([{"$badOperation": {"bar": 1}}]) |
| 686 | |
| 687 | event = listener.first_command_started() |
| 688 | self.assertEqual(event.command_name, "aggregate") |
| 689 | lsid = event.command["lsid"] |
| 690 | # Session was returned to pool despite error. |
| 691 | self.assertIn(lsid, session_ids(client)) |
| 692 | |
| 693 | def _test_cursor_helper(self, create_cursor, close_cursor): |
| 694 | coll = self.client.pymongo_test.collection |
nothing calls this directly
no test coverage detected