Skip to content

Commit 503f9fb

Browse files
committed
Clean up linter
1 parent 1d16f66 commit 503f9fb

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

test_elasticsearch_serverless/test_async/test_server/test_helpers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,12 @@ async def test_reindex_accepts_a_query(self, async_client, reindex_setup):
921921
)["_source"]
922922

923923
async def test_all_documents_get_moved(self, async_client, reindex_setup):
924-
await helpers.async_reindex(async_client, "test_index", "prod_index", bulk_kwargs={"refresh": True})
924+
await helpers.async_reindex(
925+
async_client,
926+
"test_index",
927+
"prod_index",
928+
bulk_kwargs={"refresh": "wait_for"},
929+
)
925930

926931
assert await async_client.indices.exists(index="prod_index")
927932
assert (

test_elasticsearch_serverless/test_server/conftest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ def sync_client_factory(elasticsearch_url, elasticsearch_api_key):
3636
try:
3737
# Configure the client with API key and optionally
3838
# an HTTP conn class depending on 'PYTHON_CONNECTION_CLASS' envvar
39-
kw = {'api_key': elasticsearch_api_key}
39+
kw = {"api_key": elasticsearch_api_key}
4040
if "PYTHON_CONNECTION_CLASS" in os.environ:
4141
kw["node_class"] = os.environ["PYTHON_CONNECTION_CLASS"]
4242

4343
# We do this little dance with the URL to force
4444
# Requests to respect 'headers: None' within rest API spec tests.
45-
client = elasticsearch_serverless.Elasticsearch(
46-
elasticsearch_url, **kw
47-
)
45+
client = elasticsearch_serverless.Elasticsearch(elasticsearch_url, **kw)
4846

4947
# Wipe the cluster before we start testing just in case it wasn't wiped
5048
# cleanly from the previous run of pytest?

test_elasticsearch_serverless/test_server/test_helpers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ def test_bulk_actions_remain_unchanged(sync_client):
6666
def test_bulk_all_documents_get_inserted(sync_client):
6767
docs = [{"answer": x, "_id": x} for x in range(100)]
6868
for ok, item in helpers.streaming_bulk(
69-
sync_client, docs, index="test-index", refresh=True,
69+
sync_client,
70+
docs,
71+
index="test-index",
72+
refresh=True,
7073
):
7174
assert ok
7275

@@ -873,7 +876,9 @@ def test_reindex_accepts_a_query(sync_client):
873876

874877
@pytest.mark.usefixtures("reindex_setup")
875878
def test_all_documents_get_moved(sync_client):
876-
helpers.reindex(sync_client, "test_index", "prod_index", bulk_kwargs={"refresh": True})
879+
helpers.reindex(
880+
sync_client, "test_index", "prod_index", bulk_kwargs={"refresh": True}
881+
)
877882

878883
assert sync_client.indices.exists(index="prod_index")
879884
assert 50 == sync_client.count(index="prod_index", q="type:questions")["count"]

test_elasticsearch_serverless/test_server/test_rest_api_spec.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
from elasticsearch_serverless._sync.client.utils import _base64_auth_header
4343
from elasticsearch_serverless.compat import string_types
4444

45-
from ..utils import es_api_key, es_url, parse_version
45+
from ..utils import es_api_key, es_url
4646

4747
# some params had to be changed in python, keep track of them so we can rename
4848
# those in the tests accordingly
@@ -546,10 +546,12 @@ def remove_implicit_resolver(cls, tag_to_remove):
546546
package_zip = zipfile.ZipFile(
547547
io.BytesIO(
548548
http.request(
549-
"GET", yaml_tests_url, headers={
549+
"GET",
550+
yaml_tests_url,
551+
headers={
550552
"Authorization": f"Bearer {github_token}",
551553
"Accept": "application/vnd.github+json",
552-
}
554+
},
553555
).data
554556
)
555557
)
@@ -615,6 +617,7 @@ def _pytest_param_sort_key(param: pytest.param) -> Tuple[Union[str, int], ...]:
615617
YAML_TEST_SPECS = sorted(YAML_TEST_SPECS, key=_pytest_param_sort_key)
616618

617619
if not RUN_ASYNC_REST_API_TESTS:
620+
618621
@pytest.mark.parametrize("test_spec", YAML_TEST_SPECS)
619622
def test_rest_api_spec(test_spec, sync_runner):
620623
if test_spec.get("skip", False):

0 commit comments

Comments
 (0)