Skip to content

Commit 91a38a2

Browse files
committed
Put mapping to stop relying on luck?
1 parent bebfcb8 commit 91a38a2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

test_elasticsearch_serverless/test_async/test_server/test_helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ async def test_error_is_raised(self, async_client):
364364
await helpers.async_bulk(async_client, [{"a": 42}, {"a": "c"}], index="i")
365365

366366
async def test_ignore_error_if_raised(self, async_client):
367+
await async_client.indices.create(
368+
index="i", mappings={"properties": {"a": {"type": "long"}}}
369+
)
370+
367371
# ignore only the status code in the `ignore_status` argument
368372
with pytest.raises(helpers.BulkIndexError):
369373
await helpers.async_bulk(
@@ -410,6 +414,10 @@ async def test_ignore_error_if_raised(self, async_client):
410414
)
411415

412416
async def test_client_bulk_error_if_raised(self, async_client):
417+
await async_client.indices.create(
418+
index="i", mappings={"properties": {"a": {"type": "long"}}}
419+
)
420+
413421
for i in range(10):
414422
print(async_client)
415423
resp = await async_client.bulk(

test_elasticsearch_serverless/test_server/test_helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ def test_error_is_raised(sync_client):
356356

357357

358358
def test_ignore_error_if_raised(sync_client):
359+
sync_client.indices.create(
360+
index="i", mappings={"properties": {"a": {"type": "long"}}}
361+
)
362+
359363
# ignore only the status code in the `ignore_status` argument
360364
with pytest.raises(helpers.BulkIndexError):
361365
helpers.bulk(
@@ -399,6 +403,10 @@ def test_ignore_error_if_raised(sync_client):
399403

400404

401405
def test_client_bulk_error_if_raised(sync_client):
406+
sync_client.indices.create(
407+
index="i", mappings={"properties": {"a": {"type": "long"}}}
408+
)
409+
402410
for i in range(10):
403411
print(sync_client)
404412
resp = sync_client.bulk(

0 commit comments

Comments
 (0)