Expanded type coverage to benchmarks, samples and tests. (#566)

* Renamed json samples to fix duplicate module name.

Signed-off-by: dblock <[email protected]>

* Enabled mypy on all source files.

Signed-off-by: dblock <[email protected]>

* Added missing types.

Signed-off-by: dblock <[email protected]>

* Added CHANGELOG.

Signed-off-by: dblock <[email protected]>

* Move type: ignore to fix untyped decorator makes function untyped.

Signed-off-by: dblock <[email protected]>

* Fix nox -rs lint-3.7.

Signed-off-by: dblock <[email protected]>

* Fixed incorrect import.

Signed-off-by: dblock <[email protected]>

* Fix broken test.

Signed-off-by: dblock <[email protected]>

* Fixed TestBulk::test_bulk_works_with_bytestring_body.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
This commit is contained in:
Daniel (dB.) Doubrovkine
2023-11-09 10:51:20 -05:00
committed by GitHub
parent dcb79cc322
commit 56c96d7c4f
101 changed files with 1234 additions and 1019 deletions
+7 -6
View File
@@ -28,6 +28,7 @@
import os
import time
from typing import Any
import pytest
@@ -40,11 +41,11 @@ from ..utils import wipe_cluster
# Used for
OPENSEARCH_VERSION = ""
OPENSEARCH_BUILD_HASH = ""
OPENSEARCH_REST_API_TESTS = []
OPENSEARCH_REST_API_TESTS: Any = []
@pytest.fixture(scope="session")
def sync_client_factory():
@pytest.fixture(scope="session") # type: ignore
def sync_client_factory() -> Any:
client = None
try:
# Configure the client optionally with an HTTP conn class
@@ -63,7 +64,7 @@ def sync_client_factory():
# We do this little dance with the URL to force
# Requests to respect 'headers: None' within rest API spec tests.
client = opensearchpy.OpenSearch(
OPENSEARCH_URL.replace("elastic:changeme@", ""), **kw
OPENSEARCH_URL.replace("elastic:changeme@", ""), **kw # type: ignore
)
# Wait for the cluster to report a status of 'yellow'
@@ -83,8 +84,8 @@ def sync_client_factory():
client.close()
@pytest.fixture(scope="function")
def sync_client(sync_client_factory):
@pytest.fixture(scope="function") # type: ignore
def sync_client(sync_client_factory: Any) -> Any:
try:
yield sync_client_factory
finally: