Skip to content

Commit 467de32

Browse files
committed
Fix lint, improve condition
1 parent 0d9cd28 commit 467de32

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

test_elasticsearch_serverless/test_async/test_server/test_helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,7 @@ async def test_errors_are_reported_correctly(self, async_client):
346346
assert "42" == error["index"]["_id"]
347347
assert "i" == error["index"]["_index"]
348348
print(error["index"]["error"])
349-
assert "MapperParsingException" in repr(
350-
error["index"]["error"]
351-
) or "mapper_parsing_exception" in repr(error["index"]["error"])
349+
assert error["index"]["error"]["type"] == "document_parsing_exception"
352350

353351
async def test_error_is_raised(self, async_client):
354352
await async_client.indices.create(

test_elasticsearch_serverless/test_async/test_server/test_mapbox_vector_tile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import pytest
1919

20-
from elasticsearch_serverless import AsyncElasticsearch, RequestError
20+
from elasticsearch_serverless import RequestError
2121

2222
pytestmark = pytest.mark.asyncio
2323

test_elasticsearch_serverless/test_server/test_helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,7 @@ def test_errors_are_reported_correctly(sync_client):
338338
assert "42" == error["index"]["_id"]
339339
assert "i" == error["index"]["_index"]
340340
print(error["index"]["error"])
341-
assert "MapperParsingException" in repr(
342-
error["index"]["error"]
343-
) or "mapper_parsing_exception" in repr(error["index"]["error"])
341+
assert error["index"]["error"]["type"] == "document_parsing_exception"
344342

345343

346344
def test_error_is_raised(sync_client):

test_elasticsearch_serverless/test_server/test_mapbox_vector_tile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import pytest
1919

20-
from elasticsearch_serverless import Elasticsearch, RequestError
20+
from elasticsearch_serverless import RequestError
2121

2222

2323
@pytest.fixture(scope="function")

0 commit comments

Comments
 (0)