31
31
pytestmark = [pytest .mark .asyncio ]
32
32
33
33
34
- async_bulk_xfail = pytest .mark .xfail (
35
- sys .version_info < (3 , 11 ), reason = "Investigated in issue #62"
36
- )
37
-
38
-
39
34
class AsyncMock (MagicMock ):
40
35
async def __call__ (self , * args , ** kwargs ):
41
36
return super (AsyncMock , self ).__call__ (* args , ** kwargs )
@@ -82,7 +77,6 @@ async def test_actions_remain_unchanged(self, async_client):
82
77
assert ok
83
78
assert [{"_id" : 1 }, {"_id" : 2 }] == actions
84
79
85
- @async_bulk_xfail
86
80
async def test_all_documents_get_inserted (self , async_client ):
87
81
docs = [{"answer" : x , "_id" : x } for x in range (100 )]
88
82
async for ok , item in helpers .async_streaming_bulk (
@@ -95,7 +89,6 @@ async def test_all_documents_get_inserted(self, async_client):
95
89
"_source"
96
90
]
97
91
98
- @async_bulk_xfail
99
92
async def test_documents_data_types (self , async_client ):
100
93
async def async_gen ():
101
94
for x in range (100 ):
@@ -314,7 +307,6 @@ async def test_bulk_works_with_single_item(self, async_client):
314
307
"_source"
315
308
]
316
309
317
- @async_bulk_xfail
318
310
async def test_all_documents_get_inserted (self , async_client ):
319
311
docs = [{"answer" : x , "_id" : x } for x in range (100 )]
320
312
success , failed = await helpers .async_bulk (
@@ -328,7 +320,6 @@ async def test_all_documents_get_inserted(self, async_client):
328
320
"_source"
329
321
]
330
322
331
- @async_bulk_xfail
332
323
async def test_stats_only_reports_numbers (self , async_client ):
333
324
docs = [{"answer" : x } for x in range (100 )]
334
325
success , failed = await helpers .async_bulk (
@@ -369,6 +360,10 @@ async def test_error_is_raised(self, async_client):
369
360
await helpers .async_bulk (async_client , [{"a" : 42 }, {"a" : "c" }], index = "i" )
370
361
371
362
async def test_ignore_error_if_raised (self , async_client ):
363
+ await async_client .indices .create (
364
+ index = "i" , mappings = {"properties" : {"a" : {"type" : "long" }}}
365
+ )
366
+
372
367
# ignore the status code 400 in tuple
373
368
await helpers .async_bulk (
374
369
async_client , [{"a" : 42 }, {"a" : "c" }], index = "i" , ignore_status = (400 ,)
@@ -464,7 +459,6 @@ async def scan_teardown(async_client):
464
459
465
460
466
461
class TestScan (object ):
467
- @async_bulk_xfail
468
462
async def test_order_can_be_preserved (self , async_client , scan_teardown ):
469
463
bulk = []
470
464
for x in range (100 ):
@@ -486,7 +480,6 @@ async def test_order_can_be_preserved(self, async_client, scan_teardown):
486
480
assert list (map (str , range (100 ))) == list (d ["_id" ] for d in docs )
487
481
assert list (range (100 )) == list (d ["_source" ]["answer" ] for d in docs )
488
482
489
- @async_bulk_xfail
490
483
async def test_all_documents_are_read (self , async_client , scan_teardown ):
491
484
bulk = []
492
485
for x in range (100 ):
@@ -898,7 +891,6 @@ async def reindex_setup(async_client):
898
891
899
892
900
893
class TestReindex (object ):
901
- @async_bulk_xfail
902
894
async def test_reindex_passes_kwargs_to_scan_and_bulk (
903
895
self , async_client , reindex_setup
904
896
):
@@ -920,7 +912,6 @@ async def test_reindex_passes_kwargs_to_scan_and_bulk(
920
912
await async_client .get (index = "prod_index" , id = 42 )
921
913
)["_source" ]
922
914
923
- @async_bulk_xfail
924
915
async def test_reindex_accepts_a_query (self , async_client , reindex_setup ):
925
916
await helpers .async_reindex (
926
917
async_client ,
@@ -940,7 +931,6 @@ async def test_reindex_accepts_a_query(self, async_client, reindex_setup):
940
931
await async_client .get (index = "prod_index" , id = 42 )
941
932
)["_source" ]
942
933
943
- @async_bulk_xfail
944
934
async def test_all_documents_get_moved (self , async_client , reindex_setup ):
945
935
await helpers .async_reindex (
946
936
async_client , "test_index" , "prod_index" , bulk_kwargs = {"refresh" : True }
@@ -991,7 +981,6 @@ async def reindex_data_stream_setup(async_client):
991
981
992
982
class TestAsyncDataStreamReindex (object ):
993
983
@pytest .mark .parametrize ("op_type" , [None , "create" ])
994
- @async_bulk_xfail
995
984
async def test_reindex_index_datastream (
996
985
self , op_type , async_client , reindex_data_stream_setup
997
986
):
@@ -1011,7 +1000,6 @@ async def test_reindex_index_datastream(
1011
1000
]
1012
1001
)
1013
1002
1014
- @async_bulk_xfail
1015
1003
async def test_reindex_index_datastream_op_type_index (
1016
1004
self , async_client , reindex_data_stream_setup
1017
1005
):
0 commit comments