File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -296,13 +296,16 @@ def test_update_resume_token(self):
296
296
change = next (change_stream )
297
297
self .assertEqual (change ['_id' ], change_stream ._resume_token )
298
298
299
+ @client_context .require_no_mongos # PYTHON-1739
299
300
def test_raises_error_on_missing_id (self ):
300
301
"""ChangeStream will raise an exception if the server response is
301
302
missing the resume token.
302
303
"""
303
304
with self .coll .watch ([{'$project' : {'_id' : 0 }}]) as change_stream :
304
305
self .coll .insert_one ({})
305
- with self .assertRaises (InvalidOperation ):
306
+ # Server returns an error after SERVER-37786, otherwise pymongo
307
+ # raises an error.
308
+ with self .assertRaises ((InvalidOperation , OperationFailure )):
306
309
next (change_stream )
307
310
# The cursor should now be closed.
308
311
with self .assertRaises (StopIteration ):
You can’t perform that action at this time.
0 commit comments