File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 4040 OvertCommandListener ,
4141 async_wait_until ,
4242)
43+ from test .version import Version
4344
4445from bson import encode
4546from bson .codec_options import CodecOptions
@@ -335,8 +336,6 @@ async def test_create_index(self):
335336 await db .test .create_index (["hello" , ("world" , DESCENDING )])
336337 await db .test .create_index ({"hello" : 1 }.items ()) # type:ignore[arg-type]
337338
338- # TODO: PYTHON-5491 - remove version max
339- @async_client_context .require_version_max (8 , 0 , - 1 )
340339 async def test_drop_index (self ):
341340 db = self .db
342341 await db .test .drop_indexes ()
@@ -348,7 +347,10 @@ async def test_drop_index(self):
348347 await db .test .drop_index (name )
349348
350349 # Drop it again.
351- with self .assertRaises (OperationFailure ):
350+ if async_client_context .version < Version (8 , 3 , - 1 ):
351+ with self .assertRaises (OperationFailure ):
352+ await db .test .drop_index (name )
353+ else :
352354 await db .test .drop_index (name )
353355 self .assertEqual (len (await db .test .index_information ()), 2 )
354356 self .assertIn ("hello_1" , await db .test .index_information ())
Original file line number Diff line number Diff line change 4040 OvertCommandListener ,
4141 wait_until ,
4242)
43+ from test .version import Version
4344
4445from bson import encode
4546from bson .codec_options import CodecOptions
@@ -333,8 +334,6 @@ def test_create_index(self):
333334 db .test .create_index (["hello" , ("world" , DESCENDING )])
334335 db .test .create_index ({"hello" : 1 }.items ()) # type:ignore[arg-type]
335336
336- # TODO: PYTHON-5491 - remove version max
337- @client_context .require_version_max (8 , 0 , - 1 )
338337 def test_drop_index (self ):
339338 db = self .db
340339 db .test .drop_indexes ()
@@ -346,7 +345,10 @@ def test_drop_index(self):
346345 db .test .drop_index (name )
347346
348347 # Drop it again.
349- with self .assertRaises (OperationFailure ):
348+ if client_context .version < Version (8 , 3 , - 1 ):
349+ with self .assertRaises (OperationFailure ):
350+ db .test .drop_index (name )
351+ else :
350352 db .test .drop_index (name )
351353 self .assertEqual (len (db .test .index_information ()), 2 )
352354 self .assertIn ("hello_1" , db .test .index_information ())
You can’t perform that action at this time.
0 commit comments