30
30
pytestmark = [pytest .mark .asyncio ]
31
31
32
32
33
+ async_bulk_xfail = pytest .mark .xfail (sys .version_info (sys .version_info < (3 , 11 )), reason = "Investigated in issue #62" )
34
+
33
35
class AsyncMock (MagicMock ):
34
36
async def __call__ (self , * args , ** kwargs ):
35
37
return super (AsyncMock , self ).__call__ (* args , ** kwargs )
@@ -76,6 +78,7 @@ async def test_actions_remain_unchanged(self, async_client):
76
78
assert ok
77
79
assert [{"_id" : 1 }, {"_id" : 2 }] == actions
78
80
81
+ @async_bulk_xfail
79
82
async def test_all_documents_get_inserted (self , async_client ):
80
83
docs = [{"answer" : x , "_id" : x } for x in range (100 )]
81
84
async for ok , item in helpers .async_streaming_bulk (
@@ -88,6 +91,7 @@ async def test_all_documents_get_inserted(self, async_client):
88
91
"_source"
89
92
]
90
93
94
+ @async_bulk_xfail
91
95
async def test_documents_data_types (self , async_client ):
92
96
async def async_gen ():
93
97
for x in range (100 ):
@@ -306,6 +310,7 @@ async def test_bulk_works_with_single_item(self, async_client):
306
310
"_source"
307
311
]
308
312
313
+ @async_bulk_xfail
309
314
async def test_all_documents_get_inserted (self , async_client ):
310
315
docs = [{"answer" : x , "_id" : x } for x in range (100 )]
311
316
success , failed = await helpers .async_bulk (
@@ -319,6 +324,7 @@ async def test_all_documents_get_inserted(self, async_client):
319
324
"_source"
320
325
]
321
326
327
+ @async_bulk_xfail
322
328
async def test_stats_only_reports_numbers (self , async_client ):
323
329
docs = [{"answer" : x } for x in range (100 )]
324
330
success , failed = await helpers .async_bulk (
@@ -454,6 +460,7 @@ async def scan_teardown(async_client):
454
460
455
461
456
462
class TestScan (object ):
463
+ @async_bulk_xfail
457
464
async def test_order_can_be_preserved (self , async_client , scan_teardown ):
458
465
bulk = []
459
466
for x in range (100 ):
@@ -886,6 +893,7 @@ async def reindex_setup(async_client):
886
893
887
894
888
895
class TestReindex (object ):
896
+ @async_bulk_xfail
889
897
async def test_reindex_passes_kwargs_to_scan_and_bulk (
890
898
self , async_client , reindex_setup
891
899
):
@@ -907,6 +915,7 @@ async def test_reindex_passes_kwargs_to_scan_and_bulk(
907
915
await async_client .get (index = "prod_index" , id = 42 )
908
916
)["_source" ]
909
917
918
+ @async_bulk_xfail
910
919
async def test_reindex_accepts_a_query (self , async_client , reindex_setup ):
911
920
await helpers .async_reindex (
912
921
async_client ,
@@ -926,6 +935,7 @@ async def test_reindex_accepts_a_query(self, async_client, reindex_setup):
926
935
await async_client .get (index = "prod_index" , id = 42 )
927
936
)["_source" ]
928
937
938
+ @async_bulk_xfail
929
939
async def test_all_documents_get_moved (self , async_client , reindex_setup ):
930
940
await helpers .async_reindex (
931
941
async_client , "test_index" , "prod_index" , bulk_kwargs = {"refresh" : True }
@@ -976,6 +986,7 @@ async def reindex_data_stream_setup(async_client):
976
986
977
987
class TestAsyncDataStreamReindex (object ):
978
988
@pytest .mark .parametrize ("op_type" , [None , "create" ])
989
+ @async_bulk_xfail
979
990
async def test_reindex_index_datastream (
980
991
self , op_type , async_client , reindex_data_stream_setup
981
992
):
@@ -995,6 +1006,7 @@ async def test_reindex_index_datastream(
995
1006
]
996
1007
)
997
1008
1009
+ @async_bulk_xfail
998
1010
async def test_reindex_index_datastream_op_type_index (
999
1011
self , async_client , reindex_data_stream_setup
1000
1012
):
0 commit comments