1
1
import asyncio
2
2
3
3
import pytest
4
+ from packaging import version
4
5
5
6
from arangoasync .exceptions import (
6
7
DocumentDeleteError ,
@@ -306,7 +307,7 @@ async def test_document_find(doc_col, bad_col, docs):
306
307
307
308
308
309
@pytest .mark .asyncio
309
- async def test_document_insert_many (doc_col , bad_col , docs ):
310
+ async def test_document_insert_many (cluster , db_version , doc_col , bad_col , docs ):
310
311
# Check errors
311
312
with pytest .raises (DocumentInsertError ):
312
313
await bad_col .insert_many (docs )
@@ -328,6 +329,9 @@ async def test_document_insert_many(doc_col, bad_col, docs):
328
329
assert "error" in res
329
330
330
331
# Silent mode
332
+ if cluster and db_version < version .parse ("3.12.0" ):
333
+ pytest .skip ("Skipping silent option" )
334
+
331
335
result = await doc_col .insert_many (docs , silent = True )
332
336
assert len (result ) == len (docs )
333
337
for res in result :
@@ -338,7 +342,7 @@ async def test_document_insert_many(doc_col, bad_col, docs):
338
342
339
343
340
344
@pytest .mark .asyncio
341
- async def test_document_replace_many (doc_col , bad_col , docs ):
345
+ async def test_document_replace_many (cluster , db_version , doc_col , bad_col , docs ):
342
346
# Check errors
343
347
with pytest .raises (DocumentReplaceError ):
344
348
await bad_col .replace_many (docs )
@@ -365,6 +369,9 @@ async def test_document_replace_many(doc_col, bad_col, docs):
365
369
assert "text" not in doc ["new" ]
366
370
367
371
# Silent mode
372
+ if cluster and db_version < version .parse ("3.12.0" ):
373
+ pytest .skip ("Skipping silent option" )
374
+
368
375
result = await doc_col .replace_many (docs , silent = True )
369
376
assert len (result ) == 0
370
377
await doc_col .truncate ()
@@ -375,7 +382,7 @@ async def test_document_replace_many(doc_col, bad_col, docs):
375
382
376
383
377
384
@pytest .mark .asyncio
378
- async def test_document_update_many (doc_col , bad_col , docs ):
385
+ async def test_document_update_many (db_version , cluster , doc_col , bad_col , docs ):
379
386
# Check errors
380
387
with pytest .raises (DocumentUpdateError ):
381
388
await bad_col .update_many (docs )
@@ -402,6 +409,9 @@ async def test_document_update_many(doc_col, bad_col, docs):
402
409
assert "text" in doc ["new" ]
403
410
404
411
# Silent mode
412
+ if cluster and db_version < version .parse ("3.12.0" ):
413
+ pytest .skip ("Skipping silent option" )
414
+
405
415
result = await doc_col .update_many (docs , silent = True )
406
416
assert len (result ) == 0
407
417
await doc_col .truncate ()
@@ -412,7 +422,7 @@ async def test_document_update_many(doc_col, bad_col, docs):
412
422
413
423
414
424
@pytest .mark .asyncio
415
- async def test_document_delete_many (doc_col , bad_col , docs ):
425
+ async def test_document_delete_many (db_version , cluster , doc_col , bad_col , docs ):
416
426
# Check errors
417
427
with pytest .raises (DocumentDeleteError ):
418
428
await bad_col .delete_many (docs )
@@ -444,6 +454,9 @@ async def test_document_delete_many(doc_col, bad_col, docs):
444
454
assert "error" in result [1 ]
445
455
446
456
# Silent mode
457
+ if cluster and db_version < version .parse ("3.12.0" ):
458
+ pytest .skip ("Skipping silent option" )
459
+
447
460
await doc_col .truncate ()
448
461
_ = await doc_col .insert_many (docs )
449
462
result = await doc_col .delete_many (docs , silent = True )
0 commit comments