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):
296296 change = next (change_stream )
297297 self .assertEqual (change ['_id' ], change_stream ._resume_token )
298298
299+ @client_context .require_no_mongos # PYTHON-1739
299300 def test_raises_error_on_missing_id (self ):
300301 """ChangeStream will raise an exception if the server response is
301302 missing the resume token.
302303 """
303304 with self .coll .watch ([{'$project' : {'_id' : 0 }}]) as change_stream :
304305 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 )):
306309 next (change_stream )
307310 # The cursor should now be closed.
308311 with self .assertRaises (StopIteration ):
You can’t perform that action at this time.
0 commit comments