11import pytest
2- from packaging import version
32
43from arango .exceptions import (
54 CursorCloseError ,
@@ -263,7 +262,7 @@ def test_cursor_manual_fetch_and_pop(db, col, docs):
263262 assert err .value .message == "current batch is empty"
264263
265264
266- def test_cursor_retry_disabled (db , col , docs , db_version ):
265+ def test_cursor_retry_disabled (db , col , docs ):
267266 cursor = db .aql .execute (
268267 f"FOR d IN { col .name } SORT d._key RETURN d" ,
269268 count = True ,
@@ -282,8 +281,7 @@ def test_cursor_retry_disabled(db, col, docs, db_version):
282281 # The next batch ID should have no effect
283282 cursor ._next_batch_id = "2"
284283 result = cursor .fetch ()
285- if db_version >= version .parse ("3.11.1" ):
286- assert result ["next_batch_id" ] == "4"
284+ assert result ["next_batch_id" ] == "4"
287285 doc = cursor .pop ()
288286 assert clean_doc (doc ) == docs [2 ]
289287
@@ -308,28 +306,25 @@ def test_cursor_retry(db, col, docs, db_version):
308306
309307 result = cursor .fetch ()
310308 assert result ["id" ] == cursor .id
311- if db_version >= version .parse ("3.11.0" ):
312- assert result ["next_batch_id" ] == "3"
309+ assert result ["next_batch_id" ] == "3"
313310 doc = cursor .pop ()
314311 assert clean_doc (doc ) == docs [1 ]
315312 assert cursor .empty ()
316313
317314 # Decrease the next batch ID as if the previous fetch failed
318- if db_version >= version .parse ("3.11.0" ):
319- cursor ._next_batch_id = "2"
320- result = cursor .fetch ()
321- assert result ["id" ] == cursor .id
322- assert result ["next_batch_id" ] == "3"
323- doc = cursor .pop ()
324- assert clean_doc (doc ) == docs [1 ]
325- assert cursor .empty ()
315+ cursor ._next_batch_id = "2"
316+ result = cursor .fetch ()
317+ assert result ["id" ] == cursor .id
318+ assert result ["next_batch_id" ] == "3"
319+ doc = cursor .pop ()
320+ assert clean_doc (doc ) == docs [1 ]
321+ assert cursor .empty ()
326322
327323 # Fetch the next batches normally
328324 for batch in range (2 , 5 ):
329325 result = cursor .fetch ()
330326 assert result ["id" ] == cursor .id
331- if db_version >= version .parse ("3.11.0" ):
332- assert result ["next_batch_id" ] == str (batch + 2 )
327+ assert result ["next_batch_id" ] == str (batch + 2 )
333328 doc = cursor .pop ()
334329 assert clean_doc (doc ) == docs [batch ]
335330
@@ -340,17 +335,12 @@ def test_cursor_retry(db, col, docs, db_version):
340335 doc = cursor .pop ()
341336 assert clean_doc (doc ) == docs [- 1 ]
342337
343- if db_version >= version .parse ("3.11.0" ):
344- # We should be able to fetch the last batch again
345- cursor .fetch ()
346- doc = cursor .pop ()
347- assert clean_doc (doc ) == docs [- 1 ]
338+ # We should be able to fetch the last batch again
339+ cursor .fetch ()
340+ doc = cursor .pop ()
341+ assert clean_doc (doc ) == docs [- 1 ]
348342
349- if db_version >= version .parse ("3.11.0" ):
350- assert cursor .close ()
351- else :
352- with pytest .raises (CursorCloseError ):
353- cursor .close ()
343+ assert cursor .close ()
354344
355345
356346def test_cursor_no_count (db , col ):
0 commit comments