@@ -122,17 +122,6 @@ def test_add_remove_option(self):
122122 cursor .remove_option (32 )
123123 self .assertEqual (2 , cursor ._Cursor__query_flags )
124124
125- # Exhaust - which mongos doesn't support
126- cursor = self .db .test .find (cursor_type = CursorType .EXHAUST )
127- self .assertEqual (64 , cursor ._Cursor__query_flags )
128- cursor2 = self .db .test .find ().add_option (64 )
129- self .assertEqual (cursor ._Cursor__query_flags ,
130- cursor2 ._Cursor__query_flags )
131- self .assertTrue (cursor ._Cursor__exhaust )
132- cursor .remove_option (64 )
133- self .assertEqual (0 , cursor ._Cursor__query_flags )
134- self .assertFalse (cursor ._Cursor__exhaust )
135-
136125 # Partial
137126 cursor = self .db .test .find (allow_partial_results = True )
138127 self .assertEqual (128 , cursor ._Cursor__query_flags )
@@ -142,6 +131,18 @@ def test_add_remove_option(self):
142131 cursor .remove_option (128 )
143132 self .assertEqual (0 , cursor ._Cursor__query_flags )
144133
134+ # Exhaust - which mongos doesn't support
135+ if not self .db .client .is_mongos :
136+ cursor = self .db .test .find (cursor_type = CursorType .EXHAUST )
137+ self .assertEqual (64 , cursor ._Cursor__query_flags )
138+ cursor2 = self .db .test .find ().add_option (64 )
139+ self .assertEqual (cursor ._Cursor__query_flags ,
140+ cursor2 ._Cursor__query_flags )
141+ self .assertTrue (cursor ._Cursor__exhaust )
142+ cursor .remove_option (64 )
143+ self .assertEqual (0 , cursor ._Cursor__query_flags )
144+ self .assertFalse (cursor ._Cursor__exhaust )
145+
145146
146147class TestCursor (IntegrationTest ):
147148
0 commit comments